diff --git a/src/lib/client/color.js b/src/lib/client/color.js index 8e538da..7813352 100644 --- a/src/lib/client/color.js +++ b/src/lib/client/color.js @@ -4,6 +4,9 @@ import seedrandom from "seedrandom"; * @typedef {{r: number, g: number, b: number}} rgb */ +/** @type {rgb} */ +export const black = {r: 0, g: 0, b: 0}; + /** * @param {seedrandom.PRNG} random * @returns {rgb} @@ -55,14 +58,16 @@ export function generateQuadColors(seed) { const c3 = createColor(r); const c4 = createColor(r); + const blackCorner = Math.floor(r.quick() * 4); + return { c1: c1, c2: c2, c3: c3, c4: c4, - c13: mixColors(c1, c3), - c14: mixColors(c1, c4), - c23: mixColors(c2, c3), - c24: mixColors(c2, c4), + c13: blackCorner == 0 ? black : mixColors(c1, c3), + c14: blackCorner == 1 ? black : mixColors(c1, c4), + c23: blackCorner == 2 ? black : mixColors(c2, c3), + c24: blackCorner == 3 ? black : mixColors(c2, c4), }; }