def setup
background(220)
c = color(20, 75, 200)
fill(c)
rect(15, 20, 35, 60)
greenValue = green(c) # Get green in 'c'
fill(0, greenValue, 0)
rect(50, 20, 35, 60)
end
色(カラー)オブジェクトなどから緑の値を取得します。
| 引数名 | 内容 | 備考 | オプション | デフォルト値 |
|---|---|---|---|---|
| color | p5.Colorオブジェクト | |||
| colorstring | 色文字列 | |||
| values | 配列 | [v1, v2, v3, 透明度] colorModeの設定に依存 |
緑(g)の値