Default Alpha value of navigation bar in Lollipop

僤鯓⒐⒋嵵緔 提交于 2019-12-07 09:44:20

问题


If you set android:windowTranslucentNavigation to true in your theme in Lollipop the navigation bar won't be fully translucent like in KitKat. Instead it's a dark semi-transparant background. Does anyone here know what the alpha value is of that background?


回答1:


I've made some test with navigation bar and found that alpha of navBar when android:windowTranslucentNavigation = true is 40% of black color.

So color in hex would be: #66000000

Here is steps how I calculated this value:

  1. I made screenshot as presented below
  2. Then I open it in Gimp image editor and take RGB values of each color
  3. White is (255,255,255), white under navBar (153,153,153)
  4. Grey is (150,150,150), grey under navBar (90,90,90)

Then I calculate as next: 255 is 100% 153 is x x = 153 * 100 / 255 = 60%

So I calculated invert value of alpha channel, the true value of alpha channel is 100 - 60 = 40%

ARGB value of 40% is (102,0,0,0) in hex it's #66000000



来源:https://stackoverflow.com/questions/33466295/default-alpha-value-of-navigation-bar-in-lollipop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!