brightness()

本参考资料用于Processing 3.0+。 如果你使用的是前一版本,请在使用软件帮助菜单内的参考资料。. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Core Javadoc and Libraries Javadoc.

名称

brightness()

示例
 noStroke();

colorMode(HSB, 255);

color c = color(0, 126, 255);


fill(c);

rect(15, 20, 35, 60);


float value = brightness(c);

// Sets 'value' to 255 fill(value);

rect(50, 20, 35, 60);

描述 Extracts the brightness value from a color.
语法
brightness(rgb)
参数
rgb int: any value of the color datatype
返回值 float
相关 red()
green()
blue()
alpha()
hue()
saturation()

Updated on October 2, 2018 05:02:10pm EDT

brightness()