painbrush

1.0.21.1.0
src/color/utils.d.ts
+src/color/utils.d.tsNew file
+19
Index: package/src/color/utils.d.ts
===================================================================
--- package/src/color/utils.d.ts
+++ package/src/color/utils.d.ts
@@ -0,0 +1,19 @@
+/**
+ * This is cheeky, but this would be impossible in normal colorspace and makes the math so easy
+ */
+export type AlphaColor = [-1, -1, -1];
+export type RGBColor = [r: number, g: number, b: number];
+export type Color = RGBColor | AlphaColor;
+export declare const COLOR_ALPHA: AlphaColor;
+export declare const COLOR_WHITE: Color;
+export declare const COLOR_BLACK: Color;
+/**
+ * Alphas are a cursed implementation detail that gets treated differently at blending, rn its just -1,-1,-1 but maybe in the future this can be loaded with alpha depth? or not. lol that sounds cursed.
+ */
+export declare const isAlphaColor: (color: Color) => color is AlphaColor;
+export declare const isColorMatch: (color1: Color, color2: Color) => boolean;
+/**
+ * Layers use this to mix two colors together. this is where the alpha magic happens and where blend modes can go
+ */
+export declare const blendColor: (top: null | undefined | Color, bottom: Color) => Color;
+export declare const makeRandomColor: (r: number) => Color;