def setup
# Grayscale integer value
background(220)
strokeWeight(4)
stroke(51)
rect(20, 20, 60, 60)
end
def setup
# R, G & B integer values
background(220)
stroke(255, 204, 0)
strokeWeight(4)
rect(20, 20, 60, 60)
end
def setup
# H, S & B integer values
background(220)
colorMode(HSB)
strokeWeight(4)
stroke(255, 204, 100)
rect(20, 20, 60, 60)
end
def setup
# Named SVG/CSS color string
background(220)
stroke('red')
strokeWeight(4)
rect(20, 20, 60, 60)
end
def setup
# three-digit hexadecimal RGB notation
background(220)
stroke('#fae')
strokeWeight(4)
rect(20, 20, 60, 60)
end
def setup
# six-digit hexadecimal RGB notation
background(220)
stroke('#222222')
strokeWeight(4)
rect(20, 20, 60, 60)
end
def setup
# integer RGB notation
background(220)
stroke('rgb(0, 255, 0)')
strokeWeight(4)
rect(20, 20, 60, 60)
end
def setup
# integer RGBA notation
background(220)
stroke('rgba(0, 255, 0, 0.25)')
strokeWeight(4)
rect(20, 20, 60, 60)
end
def setup
# percentage RGB notation
background(220)
stroke('rgb(100%, 0%, 10%)')
strokeWeight(4)
rect(20, 20, 60, 60)
end
def setup
# percentage RGBA notation
background(220)
stroke('rgba(100%, 0%, 100%, 0.5)')
strokeWeight(4)
rect(20, 20, 60, 60)
end
def setup
# p5 Color object
background(220)
stroke(color(0, 0, 255))
strokeWeight(4)
rect(20, 20, 60, 60)
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オブジェクト | |||
| a | 透明度 | 0~255 (0 : 完全な透明) colorModeの設定に依存 | ○ | RGBモード : 255 HSLモード/HSBモード : 1 |
なし