@tenphi/tasty 0.13.1 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +155 -51
- package/dist/config.d.ts +13 -1
- package/dist/config.js +5 -1
- package/dist/config.js.map +1 -1
- package/dist/core/index.d.ts +5 -3
- package/dist/core/index.js +4 -3
- package/dist/debug.d.ts +26 -141
- package/dist/debug.js +356 -635
- package/dist/debug.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +4 -3
- package/dist/parser/classify.js +2 -1
- package/dist/parser/classify.js.map +1 -1
- package/dist/parser/parser.js +1 -1
- package/dist/plugins/okhsl-plugin.js +2 -275
- package/dist/plugins/okhsl-plugin.js.map +1 -1
- package/dist/plugins/types.d.ts +1 -1
- package/dist/properties/index.js +2 -15
- package/dist/properties/index.js.map +1 -1
- package/dist/ssr/format-property.js +9 -7
- package/dist/ssr/format-property.js.map +1 -1
- package/dist/styles/color.js +9 -5
- package/dist/styles/color.js.map +1 -1
- package/dist/styles/createStyle.js +24 -21
- package/dist/styles/createStyle.js.map +1 -1
- package/dist/styles/index.js +1 -1
- package/dist/styles/predefined.js +1 -1
- package/dist/styles/predefined.js.map +1 -1
- package/dist/styles/types.d.ts +19 -4
- package/dist/tasty.d.ts +9 -9
- package/dist/tasty.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils/color-math.d.ts +46 -0
- package/dist/utils/color-math.js +749 -0
- package/dist/utils/color-math.js.map +1 -0
- package/dist/utils/color-space.d.ts +5 -0
- package/dist/utils/color-space.js +229 -0
- package/dist/utils/color-space.js.map +1 -0
- package/dist/utils/colors.js +3 -1
- package/dist/utils/colors.js.map +1 -1
- package/dist/utils/mod-attrs.js +1 -1
- package/dist/utils/mod-attrs.js.map +1 -1
- package/dist/utils/process-tokens.d.ts +3 -13
- package/dist/utils/process-tokens.js +18 -98
- package/dist/utils/process-tokens.js.map +1 -1
- package/dist/utils/styles.d.ts +2 -15
- package/dist/utils/styles.js +22 -217
- package/dist/utils/styles.js.map +1 -1
- package/docs/PIPELINE.md +519 -0
- package/docs/README.md +31 -0
- package/docs/adoption.md +16 -6
- package/docs/comparison.md +16 -9
- package/docs/configuration.md +26 -3
- package/docs/debug.md +152 -339
- package/docs/design-system.md +1 -1
- package/docs/dsl.md +3 -1
- package/docs/getting-started.md +29 -13
- package/docs/injector.md +2 -2
- package/docs/methodology.md +3 -1
- package/docs/runtime.md +59 -9
- package/docs/ssr.md +3 -3
- package/docs/styles.md +1 -1
- package/docs/tasty-static.md +13 -2
- package/package.json +4 -3
- package/dist/utils/hsl-to-rgb.js +0 -38
- package/dist/utils/hsl-to-rgb.js.map +0 -1
- package/dist/utils/okhsl-to-rgb.js +0 -296
- package/dist/utils/okhsl-to-rgb.js.map +0 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//#region src/utils/color-math.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Consolidated color conversion math.
|
|
4
|
+
*
|
|
5
|
+
* Single source of truth for all color space conversions used across the
|
|
6
|
+
* library: sRGB gamma, HSL, OKLab, OKLCH, OKHSL, hex parsing, named
|
|
7
|
+
* colors, and CSS string converters.
|
|
8
|
+
*
|
|
9
|
+
* This module has zero internal imports — it is a leaf dependency.
|
|
10
|
+
*
|
|
11
|
+
* Reference: https://bottosson.github.io/posts/oklab/
|
|
12
|
+
*/
|
|
13
|
+
type Vec3 = [number, number, number];
|
|
14
|
+
/**
|
|
15
|
+
* HSL to RGB.
|
|
16
|
+
* Algorithm from CSS Color 4 spec.
|
|
17
|
+
*
|
|
18
|
+
* @param h - Hue in degrees (0-360)
|
|
19
|
+
* @param s - Saturation (0-1)
|
|
20
|
+
* @param l - Lightness (0-1)
|
|
21
|
+
* @returns RGB values in 0-255 range (may have fractional values)
|
|
22
|
+
*/
|
|
23
|
+
declare function hslToRgbValues(h: number, s: number, l: number): Vec3;
|
|
24
|
+
declare function getNamedColorHex(): Map<string, string>;
|
|
25
|
+
/**
|
|
26
|
+
* Convert hex color string to `rgb()` CSS string.
|
|
27
|
+
* Supports 3, 4, 6, and 8 character hex values (with or without `#`).
|
|
28
|
+
*/
|
|
29
|
+
declare function hexToRgb(hex: string): string | null;
|
|
30
|
+
/**
|
|
31
|
+
* Extract RGB values from an `rgb()`/`rgba()` string.
|
|
32
|
+
* Supports comma-separated, space-separated, fractional, percentage,
|
|
33
|
+
* and slash alpha notation.
|
|
34
|
+
*
|
|
35
|
+
* @returns Array of RGB values (0-255 range), converting percentages as needed.
|
|
36
|
+
*/
|
|
37
|
+
declare function getRgbValuesFromRgbaString(str: string): number[];
|
|
38
|
+
/**
|
|
39
|
+
* Convert any recognized color string to an `rgb()` CSS string.
|
|
40
|
+
* Handles hex, `okhsl()`, `hsl()`/`hsla()`, named CSS colors,
|
|
41
|
+
* and `rgb()`/`rgba()` pass-through.
|
|
42
|
+
*/
|
|
43
|
+
declare function strToRgb(color: string, _ignoreAlpha?: boolean): string | null | undefined;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { getNamedColorHex, getRgbValuesFromRgbaString, hexToRgb, hslToRgbValues, strToRgb };
|
|
46
|
+
//# sourceMappingURL=color-math.d.ts.map
|