Skip to content

Commit

Permalink
feat(examples): add CSS color L4 support for hiccup-canvas-arcs
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Aug 18, 2024
1 parent 2d9e505 commit 44c2432
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions examples/hiccup-canvas-arcs/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
import { canvas2d } from "@thi.ng/canvas";
import { colorFromRange, lch } from "@thi.ng/color";
import {
colorFromRange,
CSS_LEVEL4,
lch,
setDefaultCSSConversions,
} from "@thi.ng/color";
import { arc, closestPoint, group, withAttribs } from "@thi.ng/geom";
import { draw } from "@thi.ng/hiccup-canvas";
import { TAU, fit01 } from "@thi.ng/math";
import { fit01, TAU } from "@thi.ng/math";
import { SYSTEM, weightedRandom } from "@thi.ng/random";
import { fromDOMEvent, fromRAF } from "@thi.ng/rstream";
import { map, normRange } from "@thi.ng/transducers";
import { dist, type Vec } from "@thi.ng/vectors";

// optional, configure CSS color conversions to use use CSS Color Level 4
// (i.e. direct support for LCH colors and avoiding conversions to sRGB)
setDefaultCSSConversions(CSS_LEVEL4);

const W = Math.min(window.innerWidth, window.innerHeight);
const ORIGIN = [W / 2, W / 2];

Expand Down

0 comments on commit 44c2432

Please sign in to comment.