@texel/color
Advanced tools
+4
-2
| { | ||
| "name": "@texel/color", | ||
| "version": "1.1.8", | ||
| "version": "1.1.9", | ||
| "description": "a minimal and modern color library", | ||
| "type": "module", | ||
| "main": "./src/index.js", | ||
| "types": "./types.d.ts", | ||
| "exports": { | ||
| "import": "./src/index.js" | ||
| "import": "./src/index.js", | ||
| "types": "./types.d.ts" | ||
| }, | ||
@@ -10,0 +12,0 @@ "license": "MIT", |
+5
-0
@@ -24,2 +24,6 @@ import { clamp, floatToByte, hexToRGB, vec3 } from "./util.js"; | ||
| /** | ||
| * @typedef {number[][][]} ColorGamutCoefficients | ||
| */ | ||
| /** | ||
| * @typedef {Object} ChromaticAdaptation | ||
@@ -46,2 +50,3 @@ * @property {Matrix3x3} from the matrix to convert from the source whitepoint to the destination whitepoint | ||
| * @property {ColorSpace} space the color space associated with this color gamut | ||
| * @property {ColorGamutCoefficients} [coefficients] the coefficients used during gamut mapping from OKLab | ||
| */ | ||
@@ -48,0 +53,0 @@ |
+2
-2
@@ -95,4 +95,4 @@ import { | ||
| * @param {number} b The normalized b component of the hue. | ||
| * @param {number[][]} lmsToRgb The LMS to RGB conversion matrix. | ||
| * @param {number[][][]} okCoeff The OKLab coefficients. | ||
| * @param {Matrix3x3} lmsToRgb The LMS to RGB conversion matrix. | ||
| * @param {ColorGamutCoefficients} okCoeff The OKLab coefficients. | ||
| * @returns {number} The maximum saturation. | ||
@@ -99,0 +99,0 @@ * @method |
+4
-1
@@ -18,2 +18,3 @@ declare module "@texel/color" { | ||
| type Vector = number[]; | ||
| type ColorGamutCoefficients = number[][][]; | ||
| /** | ||
@@ -51,5 +52,7 @@ * @property from - the matrix to convert from the source whitepoint to the destination whitepoint | ||
| * @property space - the color space associated with this color gamut | ||
| * @property [coefficients] - the coefficients used during gamut mapping from OKLab | ||
| */ | ||
| type ColorGamut = { | ||
| space: ColorSpace; | ||
| coefficients?: ColorGamutCoefficients; | ||
| }; | ||
@@ -161,3 +164,3 @@ /** | ||
| */ | ||
| function computeMaxSaturationOKLC(a: number, b: number, lmsToRgb: number[][], okCoeff: number[][][]): number; | ||
| function computeMaxSaturationOKLC(a: number, b: number, lmsToRgb: Matrix3x3, okCoeff: ColorGamutCoefficients): number; | ||
| /** | ||
@@ -164,0 +167,0 @@ * Retrieves the LMS to RGB conversion matrix from the given gamut. |
111047
0.38%2485
0.28%