def setup
# Grayscale integer value
background(51)
end
def setup
# R, G & B integer values
background(255, 204, 0)
end
def setup
# H, S & B integer values
colorMode(HSB)
background(255, 204, 100)
end
def setup
# Named SVG/CSS color string
background('red')
end
def setup
# three-digit hexadecimal RGB notation
background('#fae')
end
def setup
# six-digit hexadecimal RGB notation
background('#222222');
end
def setup
# integer RGB notation
background('rgb(0, 255, 0)')
end
def setup
# integer RGBA notation
background('rgba(0, 255, 0, 0.25)')
end
def setup
# percentage RGB notation
background('rgb(100%, 0%, 10%)')
end
def setup
# percentage RGBA notation
background('rgba(100%, 0%, 100%, 0.5)')
end
def setup
# p5 Color object
background(color(0, 0, 255))
end
キャンバスの背景を設定します。
| 引数名 | 内容 | 備考 | オプション | デフォルト値 |
|---|---|---|---|---|
| gray | グレースケール | 0~255 | ||
| v1 | 赤 または 色相 | 0~255 colorModeの設定に依存 | ||
| v2 | 緑 または 彩度 | 0~255 colorModeの設定に依存 | ||
| v3 | 青 または 輝度(明度) | 0~255 colorModeの設定に依存 | ||
| values | 配列 | [v1, v2, v3, 透明度] colorModeの設定に依存 | ||
| colorstring | 色文字列 | |||
| color | p5.Colorオブジェクト | |||
| image | p5.Imageオブジェクト | |||
| a | 透明度 | 0~255 (0 : 完全な透明) colorModeの設定に依存 | ○ | RGBモード : 255 HSLモード/HSBモード : 1 |
なし