参考 green()

green()

获取颜色的绿色值。

green() 从一个 p5.Color 对象、一个由颜色组件组成的数组或一个 CSS 颜色字符串中提取绿色值。

默认情况下,green() 返回一个 0 到 255 范围内的绿色值。如果 colorMode() 设置为 RGB, 它返回给定范围内的绿色值。

示例

语法

green(color)

参数

color
p5.Color|数字[]|字符串:

p5.Color 对象、颜色模组的数列或 CSS 颜色字符串。

返回值

数字: 绿色值。
This page is generated from the comments in src/color/creating_reading.js . Please feel free to edit it and submit a pull request!

相关参考