fix: Handle Joyce Geometry Applet color specifications (#33)

This PR attempts to capture all of the color structure
of the original Geometry Applet, except for pivot points
defaulting to green, since there are no pivot points yet.

Resolves #8.

Reviewed-on: #33
Co-authored-by: Glen Whitney <glen@studioinfinity.org>
Co-committed-by: Glen Whitney <glen@studioinfinity.org>
This commit is contained in:
Glen Whitney 2023-09-25 22:44:44 +00:00 committed by Glen Whitney
parent bab48b25ad
commit 01d78081a2
5 changed files with 250 additions and 33 deletions

30
etc/colorsea_types.patch Normal file
View file

@ -0,0 +1,30 @@
--- node_modules/colorsea/dist/index.d.ts 2023-09-25 11:41:07.620198667 -0700
+++ tsbuild/deps/colorsea.d.ts 2023-09-25 12:24:39.126612604 -0700
@@ -319,6 +319,9 @@
};
}
+type ColorConstructor = typeof Color
+type DeltaEfunc = typeof deltaE
+
/**
* Create a color instance
* @param colorInput Input your color value 设置颜色值
@@ -330,7 +333,7 @@
var config: (config: ColorConfig) => void;
var random: () => Color;
var convertor: typeof __convertor;
- var Color: typeof Color;
+ var Color: ColorConstructor;
var rgb: (r: number, g: number, b: number, alpha?: number | undefined) => Color;
var hsl: (h: number, s: number, l: number, alpha?: number | undefined) => Color;
var hsv: (h: number, s: number, v: number, alpha?: number | undefined) => Color;
@@ -340,7 +343,7 @@
var lab: (l: number, a: number, b: number, alpha?: number | undefined) => Color;
var lch: (l: number, c: number, h: number, alpha?: number | undefined) => Color;
var mix: (color1: string | CommonColorTuple | CommonColoraTuple | Color, color2: string | CommonColorTuple | CommonColoraTuple | Color, weight: number) => Color;
- var deltaE: typeof deltaE;
+ var deltaE: DeltaEfunc;
var utils: {
/**
* Rounding preserves the specified decimal place