Skip to content

Commit

Permalink
refactor(hiccup-canvas): update resolveColor()
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Jan 25, 2021
1 parent 0e7e955 commit 66e9a40
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/hiccup-canvas/src/color.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { isString } from "@thi.ng/checks";
import { resolveAsCSS } from "@thi.ng/color";
import { resolveAsCss } from "@thi.ng/color";
import type { DrawState } from "./api";

export const resolveColor = (v: any) => (isString(v) ? v : resolveAsCSS(v));
export const resolveColor = resolveAsCss;

export const resolveGradientOrColor = (state: DrawState, v: any) =>
isString(v)
? v[0] === "$"
? state.grads![v.substr(1)]
: v
: resolveAsCSS(v);
: resolveAsCss(v);

export const defLinearGradient = (
ctx: CanvasRenderingContext2D,
Expand Down

0 comments on commit 66e9a40

Please sign in to comment.