1local function build_triplet(w, h, x, y, mode)
2	local r = color_surface(w, h, 255, 0, 0)
3	local g = color_surface(w, h, 0, 255, 0)
4	local b = color_surface(w, h, 0, 0, 255)
5
6	move_image(r, x, y)
7	move_image(g, x, y + 0.5 * h)
8	move_image(b, x + 0.5 * w, y + 0.25 * h)
9
10	blend_image({r, g, b}, 1.0, 400)
11	blend_image({r, g, b}, 0.0, 400)
12
13	image_transform_cycle(r, true)
14	image_transform_cycle(g, true)
15	image_transform_cycle(b, true)
16
17	force_image_blend(r, mode)
18	force_image_blend(g, mode)
19	force_image_blend(b, mode)
20end
21
22function blend()
23	image_color(WORLDID, 127, 127, 127)
24
25	build_triplet(32, 32, 32, 32, BLEND_NORMAL)
26	build_triplet(32, 32, 78, 32)
27
28	build_triplet(32, 32, 32, 78, BLEND_ADD)
29	build_triplet(32, 32, 78, 78, BLEND_MULTIPLY)
30	build_triplet(32, 32, 122, 32, BLEND_SUB)
31end
32