参考 brightness()

brightness()

Gets the brightness value of a color.

brightness() extracts the HSB brightness value from a p5.Color object, an array of color components, or a CSS color string.

By default, brightness() returns a color's HSB brightness in the range 0 to 100. If the colorMode() is set to HSB, it returns the brightness value in the given range.

示例

语法

brightness(color)

参数

color
p5.Color|Number[]|String:

p5.Color object, array of color components, or CSS color string.

返回值

Number: the brightness value.
This page is generated from the comments in src/color/creating_reading.js . Please feel free to edit it and submit a pull request!

相关参考