Color Blend


Set a blend mode.

Available operations are: normal, multiply, screen, overlay, darken, lighten, colorDodge, colorBurn, softLight, hardLight, difference, exclusion, hue, saturation, color, luminosity, clear, copy, sourceIn, sourceOut, sourceAtop, destinationOver, destinationIn, destinationOut, destinationAtop, xOR, plusDarker and plusLighter,

# set a blend mode

# set a color
cmykFill(1, 0, 0, 0)
# draw a rectangle
rect(10, 10, 100, 100)
# set an other color
cmykFill(0, 1, 0, 0)
# overlap a second rectangle
rect(60, 60, 100, 100)

Color Spaces

Set a colorSpace before setting a color. Color spaces are only aviable for RGB colors.


Set the color space. Options are genericRGB, adobeRGB1998, sRGB, genericGray, genericGamma22Gray. The default is genericRGB. None will reset it back to the default.

# set a color
r, g, b, a = 0.74, 0.51, 1.04, 1

# get all available color spaces
colorSpaces = listColorSpaces()

x = 0
w = width() / len(colorSpaces)

# start loop
for space in colorSpaces:

    # set a color space
    # set the color
    fill(r, g, b)
    # draw a rect
    rect(x, 0, w, height())
    x += w

Return a list of all available color spaces.