import {createCanvas, drawRect, clipCanvas, plot} from './gfx.js'; import {randomInt, gradient} from './math.js'; import {SKY_COLORS} from './constants.js'; import {sample} from './utils.js'; export function createSky(width, height) { const ctx = createCanvas(width, height); generateSky(ctx); return ctx; } export function generateSky(ctx) { const {width, height} = ctx.canvas; const {from, to} = sample(SKY_COLORS); for (let y=0; y