@texel/color 1.1.6 → 1.1.8

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/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@texel/color",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "description": "a minimal and modern color library",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
7
+ "exports": {
8
+ "import": "./src/index.js"
9
+ },
7
10
  "license": "MIT",
8
11
  "author": {
9
12
  "name": "Matt DesLauriers",
@@ -25,11 +28,10 @@
25
28
  "terser": "^5.31.3",
26
29
  "tsd-jsdoc": "^2.5.0"
27
30
  },
28
- "types": "./types/types.d.ts",
29
31
  "scripts": {
30
32
  "visualize": "canvas-sketch-cli test/canvas-graph.js --open",
31
- "docs": "jsdoc src -t node_modules/better-docs -c tools/.jsdoc.json -d docs -R DOC.md",
32
- "types": "jsdoc src -t node_modules/tsd-jsdoc/dist -c tools/.jsdoc.types.json -d types",
33
+ "docs": "jsdoc src -r -t node_modules/better-docs -c tools/.jsdoc.json -d docs -R DOC.md",
34
+ "types": "jsdoc src -r -t node_modules/tsd-jsdoc/dist -c tools/.jsdoc.types.json -d .",
33
35
  "test": "faucet test/test*.js",
34
36
  "bench": "node test/bench-colorjs.js",
35
37
  "bench:node": "NODE_ENV=production node --prof --no-logfile-per-isolate test/bench-node.js && node --prof-process v8.log",
@@ -216,6 +216,116 @@ declare module "@texel/color" {
216
216
  * @returns The OKHSV color as an array [h, s, v].
217
217
  */
218
218
  function OKLabToOKHSV(lab: Vector, gamut?: ColorGamut, out?: Vector): Vector;
219
+ /**
220
+ * The Adobe RGB (1998) color space in linear form, without a transfer function, aliased as <code>"a98-rgb-linear"</code>.
221
+ */
222
+ const A98RGBLinear: ColorSpace;
223
+ /**
224
+ * The Adobe RGB (1998) color space, with a transfer function, aliased as <code>"a98-rgb"</code>. Inherits from the {@link A98RGBLinear} color space.
225
+ */
226
+ const A98RGB: ColorSpace;
227
+ /**
228
+ * A color gamut for the {@link A98RGB}, or Adobe RGB (1998), color space.
229
+ */
230
+ const A98RGBGamut: ColorGamut;
231
+ /**
232
+ * The Display-P3 color space in linear form, without a transfer function, aliased as <code>"display-p3-linear"</code>.
233
+ */
234
+ const DisplayP3Linear: ColorSpace;
235
+ /**
236
+ * The Display-P3 color space, with a transfer function, aliased as <code>"display-p3"</code>. Inherits from the {@link DisplayP3Linear} color space.
237
+ */
238
+ const DisplayP3: ColorSpace;
239
+ /**
240
+ * A color gamut for the {@link DisplayP3} color space.
241
+ */
242
+ const DisplayP3Gamut: ColorGamut;
243
+ /**
244
+ * The OKLab color space.
245
+ */
246
+ const OKLab: ColorSpace;
247
+ /**
248
+ * The OKLCH color space, with Lightness, Chroma, and Hue components. This is the cylindrical form of the {@link OKLab} color space.
249
+ */
250
+ const OKLCH: ColorSpace;
251
+ /**
252
+ * An implementation of the OKHSL color space, fixed to the {@link sRGBGamut}. This is useful for color pickers and other applications where
253
+ * you wish to work with components in a well-defined and enclosed cylindrical form. If you wish to use OKHSL with a different gamut, you'll
254
+ * need to use the {@link OKHSLToOKLab} and {@link OKLabToOKHSL} methods directly, passing your desired gamut.
255
+ */
256
+ const OKHSL: ColorSpace;
257
+ /**
258
+ * An implementation of the OKHSV color space, fixed to the {@link sRGBGamut}. This is useful for color pickers and other applications where
259
+ * you wish to work with components in a well-defined and enclosed cylindrical form. If you wish to use OKHSL with a different gamut, you'll
260
+ * need to use the {@link OKHSLToOKLab} and {@link OKLabToOKHSL} methods directly, passing your desired gamut.
261
+ */
262
+ const OKHSV: ColorSpace;
263
+ /**
264
+ * The ProPhotoRGB color space in linear form, without a transfer function, aliased as <code>"prophoto-rgb-linear"</code>.
265
+ */
266
+ const ProPhotoRGBLinear: ColorSpace;
267
+ /**
268
+ * The ProPhotoRGB color space, with a transfer function, aliased as <code>"prophoto-rgb"</code>. Inherits from the {@link ProPhotoRGBLinear} color space.
269
+ */
270
+ const ProPhotoRGB: ColorSpace;
271
+ /**
272
+ * The Rec2020 color space in linear form, without a transfer function, aliased as <code>"rec2020-linear"</code>.
273
+ */
274
+ const Rec2020Linear: ColorSpace;
275
+ /**
276
+ * The Rec2020 color space, with a transfer function, aliased as <code>"rec2020"</code>. Inherits from the {@link Rec2020Linear} color space.
277
+ */
278
+ const Rec2020: ColorSpace;
279
+ /**
280
+ * A color gamut for the {@link Rec2020} color space.
281
+ */
282
+ const Rec2020Gamut: ColorGamut;
283
+ /**
284
+ * The sRGB color space in linear form, without a transfer function, aliased as <code>"srgb-linear"</code>.
285
+ */
286
+ const sRGBLinear: ColorSpace;
287
+ /**
288
+ * The sRGB color space, with a transfer function, aliased as <code>"srgb"</code>. Inherits from the {@link sRGBLinear} color space.
289
+ */
290
+ const sRGB: ColorSpace;
291
+ /**
292
+ * A color gamut for the {@link sRGB} color space.
293
+ */
294
+ const sRGBGamut: ColorGamut;
295
+ /**
296
+ * Converts a single sRGB gamma-corrected channel value to linear light (un-companded) form.
297
+ * @param val - The sRGB gamma-corrected channel value in the range [0, 1].
298
+ * @returns The linear light channel value.
299
+ */
300
+ function sRGBGammaToLinear(val: number): number;
301
+ /**
302
+ * Converts a single linear-light channel value to sRGB gamma-corrected form.
303
+ * @param val - The linear-light channel value in the range [0, 1].
304
+ * @returns The sRGB gamma-corrected channel value.
305
+ */
306
+ function sRGBLinearToGamma(val: number): number;
307
+ /**
308
+ * Converts a color from XYZ with D65 whitepoint to XYZ with D50 whitepoint.
309
+ * @param XYZ - The input color in XYZ with D65 whitepoint.
310
+ * @param [out = vec3()] - The output color in XYZ with D50 whitepoint.
311
+ * @returns The converted color in XYZ with D50 whitepoint.
312
+ */
313
+ function XYZD65ToD50(XYZ: Vector, out?: Vector): Vector;
314
+ /**
315
+ * Converts a color from XYZ with D50 whitepoint to XYZ with D65 whitepoint.
316
+ * @param XYZ - The input color in XYZ with D50 whitepoint.
317
+ * @param [out = vec3()] - The output color in XYZ with D65 whitepoint.
318
+ * @returns The converted color in XYZ with D65 whitepoint.
319
+ */
320
+ function XYZD50ToD65(XYZ: Vector, out?: Vector): Vector;
321
+ /**
322
+ * XYZ color space with D65 whitepoint, aliased as <code>"xyz"</code>.
323
+ */
324
+ const XYZ: ColorSpace;
325
+ /**
326
+ * XYZ color space with D50 whitepoint, aliased as <code>"xyz-d50"</code>.
327
+ */
328
+ const XYZD50: ColorSpace;
219
329
  /**
220
330
  * Returns a list of color spaces.
221
331
  * @returns An array of color space objects.