Convert colorPrimary to colorPrimaryDark (how much darker)
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In guidance with Material Design, how much darker should the statusbar be than the actionbar? I have a color set for the actionbar at runtime and have no way of knowing this colour at programming time, so how can I get the correct statusbar colour? I know i can darken a colour using this this.getSupportActionBar().setBackgroundDrawable(new ColorDrawable(colorPrimary)); float[] hsv = new float[3]; Color.colorToHSV(colorPrimary, hsv); hsv[2] *= 0.8f; int colorPrimaryDark = Color.HSVToColor(hsv); if(Build.VERSION.SDK_INT>=21) Chat.this