ColorUtils.java 文件源码

java
阅读 39 收藏 0 点赞 0 评论 0

项目:GitHub 作者:
/**
 * Returns the luminance of a color as a float between {@code 0.0} and {@code 1.0}.
 * <p>Defined as the Y component in the XYZ representation of {@code color}.</p>
 */
@FloatRange(from = 0.0, to = 1.0)
public static double calculateLuminance(@ColorInt int color) {
    final double[] result = getTempDouble3Array();
    colorToXYZ(color, result);
    // Luminance is the Y component
    return result[1] / 100;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号