blue

def setup
  background(220)

  c = color(175, 100, 220)
  fill(c)
  rect(15, 20, 35, 60)

  blueValue = blue(c)      # Get blue in 'c'
  fill(0, 0, blueValue)
  rect(50, 20, 35, 60)
end

p5.jsリファレンス(参考情報)

[p5.js] blue

概要

色(カラー)オブジェクトなどから青の値を取得します。

書式

blue(color)
blue(colorstring)
blue(values)

引数

引数名内容備考オプションデフォルト値
colorp5.Colorオブジェクト
colorstring色文字列
values配列[v1, v2, v3, 透明度]
colorModeの設定に依存

戻値

青(b)の値

備考

関連