View source
Pathogen · 62 lines
define ViewBox(0, 0, 1780, 3600);
define default PathLayer('main-path-layer') ${
fill: #bbb;
stroke: #222;
stroke-width: 1;
};
// viewBox="0 0 400 400"
// Color Wheel — Classic 360° Conic Gradient
// The "hello world" of conic gradients: a full rainbow sweep
// --- Gradients ---
let width = 1780;
let height = 3600;
let blue = oklch(0.45 0.15 257);
let yellow = oklch(0.86 0.18 98);
let wheel_outer = ConicGradient('wheel-outer', -480, 1200) {|g|
g.stop(0, blue.alpha(0.01));
g.stop(0.0833, blue.alpha(0.2));
g.stop(0.1667, blue.alpha(0.5));
g.stop(0.25, blue.alpha(0.9));
g.stop(0.3333, blue.alpha(0.6));
g.stop(0.4165, blue.alpha(0.3));
g.stop(0.5000, blue.alpha(0.7));
g.stop(0.5830, blue.alpha(0.7));
g.stop(0.6667, yellow.alpha(0.3));
g.stop(0.7497, yellow.alpha(0.7));
g.stop(0.833, yellow.alpha(0.4));
g.stop(0.9163, yellow.alpha(0.8));
g.stop(1, yellow.alpha(0.01));
};
wheel_outer.innerRadius = 65;
wheel_outer.innerFill = 'transparent';
wheel_outer.spread = 'transparent';
wheel_outer.interpolation = 'oklch';
wheel_outer.from = -0.375pi;
wheel_outer.to = 0.375pi;
// --- Background ---
let bg = PathLayer('bg') ${ fill: #0e0e18; stroke: none; };
bg.apply { rect(0, 0, width, height); }
// --- Outer ring (donut) ---
let ring = PathLayer('ring') ${
fill: wheel_outer;
stroke: wheel_outer;
stroke-width: 1;
};
ring.apply {
triangleGrid(GridPatternType.Shape, 0, 0, calc(width + 10), height, 32);
}
// --- Scene ---
let scene = GroupLayer('scene') ${};
scene.append(bg, ring);