Translucent colors through Cairo
// Under a shell type: box -l g translucent.box
// ---
// Here we show translucent effects on Cairo Windows.
include "g"
w = Window[][
BBox[(-20, -18), (20, 22)]
c1 = Color[color.red, .a=0.5], c2 = Color[color.yellow, .a=0.5]
c3 = Color[color.blue, .a=0.5], c4 = Color[color.green, .a=0.5]
radius = 20.0
Circle[(-5, -2), 4, c4] // One circle (behind)
i = 0, delta = 4*const.pi/5, angle0 = const.pi/2 // The star
Line[radius*Vec[i*delta + angle0], For[++i < 5]
Close[], Border[2, c1, Join["round"]]]
Circle[(2, -5), 8, c2] // Other two circles
Circle[(-1, 1), 6, c3]
]
w.Save["translucency.png"
Window["rgb24", .Res[Dpi[100]]]] // Save to PNG