2

I'm trying to make a Layout button like the one in this photo with a transparent glassy color.

enter image description here

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid android:color="@color/glassColor"/>
    <stroke android:width="1dp"
        android:color="@color/colorWhite"/>
</shape>

I have the drawable, but I can't figure out how to create a hex color like the one in the picture

DIRTY DAVE
  • 2,523
  • 2
  • 20
  • 83
  • Try a [gradient background](https://stackoverflow.com/questions/13929877/how-to-make-gradient-background-in-android) .. Alternatively you can use an image as background .. – ADM Jun 22 '20 at 05:27
  • for you, it is better to use a blur effect on the background of your layout. – Jr Takhirovich Jun 22 '20 at 05:30

1 Answers1

1

I am not sure this is the answer you are looking for but if you create a new color value @color/ you can access the built in color pane to set the color transparency. I am sure you know this by now and surely my answer is not what you have expected.

<color name="colortransparent">#4F784A06</color>
  • 1
    That color is perfect. I've tried white #4FFFFFFF i.imgur.com/ftHzm8D.png but it just doesn't look good. How did you decide on that color? Do you have a tool that picks the best hex color? – DIRTY DAVE Jun 22 '20 at 06:44
  • Thank you so much. Its the custom color picker on Android Studio. – FRANCIS FERNANDO Jun 22 '20 at 12:46