Name

colorMode()

Examples
noStroke()
colorMode(RGB, 100)
for i in range(100): 
    for j in range(100): 
        stroke(i, j, 0)
        point(i, j)
noStroke()
colorMode(HSB, 100)
for i in range(100): 
    for j in range(100): 
        stroke(i, j, 100)
        point(i, j)
# If the color is defined here, it won't be 
# affected by the colorMode() in setup(). 
# Instead, just declare the variable here and 
# assign the value after the colorMode() in setup()
#bg = color(180, 50, 50) # No

def setup():
    size(100, 100)
    colorMode(HSB, 360, 100, 100)
    global bg
    bg = color(180, 50, 50)

def draw(): 
    background(bg)	
Description
Syntax
colorMode(mode)
colorMode(mode, max)
colorMode(mode, max1, max2, max3)
colorMode(mode, max1, max2, max3, maxA)
Parameters
mode
max
max1
max2
max3
maxA
Related background()
fill()
stroke()
Updated on Wed Jan 18 17:32:21 2017.
Creative Commons License