We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
private static int calculateStatusColor(@ColorInt int color, int alpha) 这个方法的算法会不会有问题? 比如我直接在 colors.xml 资源文件中定义带有透明度的值,然后通过 resource.getColor() 获取到的值,与通过 calculateStatusColor() 方法获取到的值不一样。
private static int calculateStatusColor(@ColorInt int color, int alpha)
比如我定义了 <color name="color40">#66FF900</color> <color name="color60">#99FF900</color> <color name="color_original">#FF900</color> 通过 resource.getColor() 获取 R.color.color40 和 R.color.color60,然后分别与 calculateStatusColor(resource.getColor(R.color.color_original), 102) 和 calculateStatusColor(resource.getColor(R.color.color_original), 153) 去比较,发现对应不上。 (PS: 25540%=102, 25560%=153)
<color name="color40">#66FF900</color> <color name="color60">#99FF900</color> <color name="color_original">#FF900</color>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
private static int calculateStatusColor(@ColorInt int color, int alpha)
这个方法的算法会不会有问题? 比如我直接在 colors.xml 资源文件中定义带有透明度的值,然后通过 resource.getColor() 获取到的值,与通过 calculateStatusColor() 方法获取到的值不一样。
比如我定义了
<color name="color40">#66FF900</color> <color name="color60">#99FF900</color> <color name="color_original">#FF900</color>
通过 resource.getColor() 获取 R.color.color40 和 R.color.color60,然后分别与 calculateStatusColor(resource.getColor(R.color.color_original), 102) 和 calculateStatusColor(resource.getColor(R.color.color_original), 153) 去比较,发现对应不上。
(PS: 25540%=102, 25560%=153)
The text was updated successfully, but these errors were encountered: