Satimage Previous
RGB disks
Home Documentation Smile The graphic library Samples RGB disks  
The illustration shows the pattern obtained by illuminating a white surface with a red, a green and a blue light beams. Where two beams intersect the white surface shows yellow, magenta or cyan, and only where the three intersect the white surface looks white.

This example features SetBlendMode.
Import script

set r to 20
BeginFigure(0)
SetUserTransformation({r, 0, 0, r, 3 * r, 2.5 * r})
SetBlendMode(2)
set centers to {{0, 1}, {(sin pi / 3), -0.5}, {-1 * (sin pi / 3), -0.5}}
set colors to {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}
repeat with i from 1 to 3
    SetFillColor(item i of colors)
    CirclePath(item i of centers, 1.3)
    DrawPath(0)
end repeat

SetBlendMode(0)
set colors to {{1, 1, 0}, {0, 1, 1}, {1, 0, 1}}
SetUserTranslation(6, 0)
SetFillColor({0, 0, 0})
set x to -2.5
RectPath({-x, -x, 2 * x, 2 * x})
DrawPath(0)
BeginLayer()
SetBlendMode(1)
repeat with i from 1 to 3
    SetFillColor(item i of colors)
    CirclePath(item i of centers, 1.3)
    DrawPath(0)
end repeat
EndLayer()
EndFigure()
Version française
Copyright ©2008 Paris, Satimage