@stacksjs/ts-css 0.3.28 → 0.3.29

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.
@@ -44,6 +44,23 @@ export declare function resolveLineHeight(value: string, fontSize: number, rootF
44
44
  export declare function resolveColor(value: string, options?: ColorOptions): ResolvedColor | undefined;
45
45
  /** `#rrggbb`, or `#rrggbbaa` when not opaque. Meaningful for an sRGB colour. */
46
46
  export declare function colorToHex(color: ResolvedColor): string;
47
+ /**
48
+ * Whether sRGB holds the colour, so its hex draws it as the browser does.
49
+ *
50
+ * An sRGB colour always does. A Display P3 one does when each sRGB channel
51
+ * lands within rounding of the 8-bit range: then `colorToHex` of the same
52
+ * value resolved with `space: 'srgb'` is the colour, not a clamp of it. A
53
+ * renderer that can draw P3 needs the P3 value only for the colours that fail
54
+ * this: 82 of the default palette's 242. (95 leave sRGB at all, but 13 pale
55
+ * tints by less than half a step, which their hex already draws.) See #47.
56
+ */
57
+ export declare function isInSrgbGamut(color: ResolvedColor): boolean;
58
+ /**
59
+ * The colour as a CSS value a native renderer reads: `#rrggbb[aa]` for sRGB,
60
+ * `color(display-p3 r g b[ / a])` for Display P3 (#47). Channels go to four
61
+ * places, finer than an 8-bit step.
62
+ */
63
+ export declare function colorToCSS(color: ResolvedColor): string;
47
64
  /**
48
65
  * Resolving utilities for a renderer that is not a browser.
49
66
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/ts-css",
3
3
  "type": "module",
4
- "version": "0.3.28",
4
+ "version": "0.3.29",
5
5
  "description": "Pure-TypeScript CSS toolkit and utility-first CSS engine for Bun/Node — parser, walker, generator, selector engine, minifier, and a Tailwind-compatible utility engine. Zero runtime deps.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",