Friday, 29 June 2018

Convert css gradient in to android gradient (xml)

I would like to convert css gradient to android xml gradient (shape) file

for e.g

background-image: linear-gradient(to right, #ff8177 0%, #ff867a 0%, #ff8c7f 21%, #f99185 52%, #cf556c 78%, #b12a5b 100%);

to

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <gradient
        android:angle="0"
        android:endColor="#b12a5b"
        android:startColor="#ff867a"
        android:type="linear" />
</shape>

I don't know much about css. I know only android and there are only three parameters for colors android:endColor, android:startColor, android:centerColor How can I define this % and various colors presented in css

is there any online tool from where I can generate the xml file by giving css input.



from Convert css gradient in to android gradient (xml)

No comments:

Post a Comment