Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e452cfc
Bootstrapping package
Antonio-Laguna May 1, 2022
4203628
Merge branch 'main' into feature/color-helpers
Antonio-Laguna May 3, 2022
4feb9be
Configuring tsconfig.json
Antonio-Laguna May 3, 2022
d825445
Ensuring no loss of precission is disabled
Antonio-Laguna May 3, 2022
8dc9dc3
Adding global Color
Antonio-Laguna May 3, 2022
5abe02d
Adding all of the functions
Antonio-Laguna May 3, 2022
d224c83
Merge branch 'main' into feature/color-helpers
Antonio-Laguna May 21, 2022
d3d6cfc
Keeping track of changes
Antonio-Laguna May 21, 2022
5f460fe
Updating global lock
Antonio-Laguna May 21, 2022
bd75958
Creating exports
Antonio-Laguna May 21, 2022
a604c00
Linting
Antonio-Laguna May 21, 2022
ba8da1c
Some docs
Antonio-Laguna May 23, 2022
44afdc5
Merge branch 'main' into feature/color-helpers
Antonio-Laguna May 24, 2022
3bcd1bd
Getting creative
Antonio-Laguna May 25, 2022
b756c55
Merge branch 'main' into feature/color-helpers
Antonio-Laguna Jun 11, 2022
c29a59f
Revert "Getting creative"
Antonio-Laguna Jun 11, 2022
8112127
Exporting
Antonio-Laguna Jun 11, 2022
8917493
Merge remote-tracking branch 'origin/main' into feature/color-helpers
romainmenke Jan 29, 2023
7d59940
fix
romainmenke Jan 29, 2023
25a13ae
bring in latest changes
romainmenke Jan 29, 2023
eebc81b
remove license from code that was written by me
romainmenke Jan 29, 2023
7134781
wip
romainmenke Jan 29, 2023
899bed1
add named colors
romainmenke Jan 29, 2023
c03e024
tweaks
romainmenke Jan 30, 2023
344837c
migrate some plugins
romainmenke Jan 30, 2023
667747f
use the final conversion helpers
romainmenke Jan 30, 2023
5745348
one more plugin
romainmenke Jan 30, 2023
9856951
final conversions
romainmenke Jan 30, 2023
6b2614b
Merge branch 'main' into feature/color-helpers
romainmenke Jan 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'origin/main' into feature/color-helpers
  • Loading branch information
romainmenke committed Jan 29, 2023
commit 8917493db5fd2e49cb691cee72a9b7792201a02c
5,058 changes: 49 additions & 5,009 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion packages/color-helpers/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ package-lock.json
yarn.lock
*.result.css
*.result.css.map
dist/*
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/map-gamut.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*/
export declare function binarySearchGamut(startOKLCH: Color, toDestination: (x: Color) => Color, fromDestination: (x: Color) => Color): Color;
1 change: 1 addition & 0 deletions packages/color-helpers/dist/calculations/contrast.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare function contrast(RGB1: Color, RGB2: Color): number;
10 changes: 10 additions & 0 deletions packages/color-helpers/dist/calculations/delta-EOK.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* @description Calculate deltaE OK which is the simple root sum of squares
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/deltaEOK.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/deltaEOK.js
*/
export declare function deltaEOK(reference: Color, sample: Color): number;
6 changes: 6 additions & 0 deletions packages/color-helpers/dist/calculations/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export * from './binary-search-gamut';
export * from './polar-premultiply';
export * from './map-gamut';
export * from './delta-EOK';
export * from './contrast';
export * from './multiply-matrices';
6 changes: 6 additions & 0 deletions packages/color-helpers/dist/calculations/map-gamut.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/map-gamut.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*/
export declare function mapGamut(startOKLCH: Color, toDestination: (x: Color) => Color, fromDestination: (x: Color) => Color): Color;
12 changes: 12 additions & 0 deletions packages/color-helpers/dist/calculations/multiply-matrices.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Simple matrix (and vector) multiplication
* Warning: No error handling for incompatible dimensions!
* @author Lea Verou 2020 MIT License
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/multiply-matrices.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/multiply-matrices.js
*/
export declare function multiplyMatrices(a: Array<Array<number>> | Array<number>, b: Array<Array<number>> | Array<number>): Array<Array<number>> | Array<number>;
15 changes: 15 additions & 0 deletions packages/color-helpers/dist/calculations/polar-premultiply.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Given a color in a cylindical polar colorspace and an alpha value
* return the premultiplied form. The index says which entry in the
* color array corresponds to hue angle for example, in OKLCH it
* would be 2 while in HSL it would be 0
*
* @param color
* @param alpha
* @param hueIndex
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*/
export declare function polarPremultiply(color: Color, alpha: number, hueIndex: number): Color;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare function a98_RGB_to_sRGB(a98: Color): Color;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare function cie_XYZ_50_to_sRGB(xyz: Color): Color;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare function cie_XYZ_65_to_sRGB(xyz: Color): Color;
2 changes: 2 additions & 0 deletions packages/color-helpers/dist/conversions/constants.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export declare const D50: number[];
export declare const D65: number[];
1 change: 1 addition & 0 deletions packages/color-helpers/dist/conversions/d50-to-d65.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare function D50_to_D65(XYZ: Color): Color;
1 change: 1 addition & 0 deletions packages/color-helpers/dist/conversions/d65-to-d50.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare function D65_to_D50(XYZ: Color): Color;
9 changes: 9 additions & 0 deletions packages/color-helpers/dist/conversions/gam-2020.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Convert an array of linear-light rec2020 RGB in the range 0.0-1.0
* to gamma corrected form ITU-R BT.2020-2 p.4
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*/
export declare function gam_2020(RGB: Color): Color;
9 changes: 9 additions & 0 deletions packages/color-helpers/dist/conversions/gam-a98rgb.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Convert an array of linear-light a98-rgb in the range 0.0-1.0
* to gamma corrected form. Negative values are also now accepted
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*/
export declare function gam_a98rgb(RGB: Color): Color;
9 changes: 9 additions & 0 deletions packages/color-helpers/dist/conversions/gam-p3.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Convert an array of linear-light display-p3 RGB in the range 0.0-1.0
* to gamma corrected form
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*/
export declare function gam_P3(RGB: Color): Color;
10 changes: 10 additions & 0 deletions packages/color-helpers/dist/conversions/gam-pro-photo.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Convert an array of linear-light prophoto-rgb in the range 0.0-1.0
* to gamma corrected form.
* Transfer curve is gamma 1.8 with a small linear portion.
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*/
export declare function gam_ProPhoto(RGB: Color): Color;
13 changes: 13 additions & 0 deletions packages/color-helpers/dist/conversions/gam-srgb.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Convert an array of linear-light sRGB values in the range 0.0-1.0 to gamma corrected form
* Extended transfer function:
* For negative values, linear portion extends on reflection
* of axis, then uses reflected pow below that
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*
* @see https://en.wikipedia.org/wiki/SRGB
*/
export declare function gam_sRGB(RGB: Color): Color;
14 changes: 14 additions & 0 deletions packages/color-helpers/dist/conversions/hsl-to-rgb.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* For simplicity, this algorithm assumes that the hue has been normalized to a
* number in the half-open range [0, 6), and the saturation and lightness have
* been normalized to the range [0, 1]. It returns an array of three numbers
* representing the red, green, and blue channels of the colors, normalized
* to the range [0, 1]
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js
*/
export declare function HSLToRGB(hsl: Color): Color;
8 changes: 8 additions & 0 deletions packages/color-helpers/dist/conversions/hue-to-rgb.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js
*/
export declare function hueToRGB(t1: number, t2: number, hue: number): number;
57 changes: 57 additions & 0 deletions packages/color-helpers/dist/conversions/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
export * from './a98-rgb-to-srgb';
export * from './cie-xyz-50-to-srgb';
export * from './cie-xyz-65-to-srgb';
export * from './constants';
export * from './d50-to-d65';
export * from './d65-to-d50';
export * from './gam-2020';
export * from './gam-a98rgb';
export * from './gam-p3';
export * from './gam-pro-photo';
export * from './gam-srgb';
export * from './hsl-to-rgb';
export * from './hue-to-rgb';
export * from './lab-to-lch';
export * from './lab-to-p3';
export * from './lab-to-srgb';
export * from './lab-to-xyz';
export * from './lch-to-lab';
export * from './lch-to-p3';
export * from './lch-to-rec2020';
export * from './lch-to-srgb';
export * from './lin-2020';
export * from './lin-2020-to-xyz';
export * from './lin-a98rgb';
export * from './lin-a98rgb-to-xyz';
export * from './lin-p3';
export * from './lin-p3-to-xyz';
export * from './lin-pro-photo';
export * from './lin-pro-photo-to-xyz';
export * from './lin-srgb';
export * from './lin-srgb-to-xyz';
export * from './naive-cmyk-to-srgb';
export * from './oklab-to-oklch';
export * from './oklab-to-p3';
export * from './oklab-to-srgb';
export * from './oklab-to-xyz';
export * from './oklch-to-oklab';
export * from './oklch-to-p3';
export * from './oklch-to-srgb';
export * from './p3-to-lch';
export * from './p3-to-srgb';
export * from './pro-photo-rgb-to-srgb';
export * from './rec2020-to-lch';
export * from './rec2020-to-srgb';
export * from './srgb-linear-to-srgb';
export * from './srgb-to-lch';
export * from './srgb-to-luminance';
export * from './srgb-to-srgb';
export * from './xyz-to-lab';
export * from './xyz-to-lin-2020';
export * from './xyz-to-lin-a98rgb';
export * from './xyz-to-lin-p3';
export * from './xyz-to-lin-pro-photo';
export * from './xyz-to-lin-srgb';
export * from './xyz-to-oklab';
export * from './xyz-to-uv';
export * from './xyz-to-xy';
6 changes: 6 additions & 0 deletions packages/color-helpers/dist/conversions/lab-to-lch.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*/
export declare function Lab_to_LCH(Lab: Color): Color;
1 change: 1 addition & 0 deletions packages/color-helpers/dist/conversions/lab-to-p3.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare function Lab_to_P3(labRaw: Color): [Color, boolean];
1 change: 1 addition & 0 deletions packages/color-helpers/dist/conversions/lab-to-srgb.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare function Lab_to_sRGB(labRaw: Color): Color;
1 change: 1 addition & 0 deletions packages/color-helpers/dist/conversions/lab-to-xyz.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare function Lab_to_XYZ(Lab: Color): Color;
6 changes: 6 additions & 0 deletions packages/color-helpers/dist/conversions/lch-to-lab.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*/
export declare function LCH_to_Lab(LCH: Color): Color;
1 change: 1 addition & 0 deletions packages/color-helpers/dist/conversions/lch-to-p3.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare function LCH_to_P3(lchRaw: Color): [Color, boolean];
14 changes: 14 additions & 0 deletions packages/color-helpers/dist/conversions/lch-to-rec2020.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* Convert an array of CIE LCH values to CIE Lab, and then to XYZ, adapt from
* D50 to D65, then convert XYZ to linear-light rec.2020 and finally to gamma
* corrected rec.2020 for in-gamut colors, components are in the 0.0 to 1.0
* range out of gamut colors may have negative components or components greater
* than 1.0 so check for that :)
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js
*/
export declare function LCH_to_rec2020(LCH: Color): Color;
1 change: 1 addition & 0 deletions packages/color-helpers/dist/conversions/lch-to-srgb.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare function LCH_to_sRGB(lchRaw: Color): Color;
11 changes: 11 additions & 0 deletions packages/color-helpers/dist/conversions/lin-2020-to-xyz.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Convert an array of linear-light rec2020 values to CIE XYZ
* using D65 (no chromatic adaptation)
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*
* @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
*/
export declare function lin_2020_to_XYZ(rgb: Color): Color;
10 changes: 10 additions & 0 deletions packages/color-helpers/dist/conversions/lin-2020.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Convert an array of rec2020 RGB values in the range 0.0 - 1.0
* to linear light (un-companded) form.
* ITU-R BT.2020-2 p.4
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*/
export declare function lin_2020(RGB: Color): Color;
17 changes: 17 additions & 0 deletions packages/color-helpers/dist/conversions/lin-a98rgb-to-xyz.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Convert an array of linear-light a98-rgb values to CIE XYZ
* http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
* has greater numerical precision than section 4.3.5.3 of
* https://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf
* but the values below were calculated from first principles
* from the chromaticity coordinates of R G B W
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*
* @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
* @see https://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/matrixmaker.html
*/
export declare function lin_a98rgb_to_XYZ(rgb: Color): Color;
9 changes: 9 additions & 0 deletions packages/color-helpers/dist/conversions/lin-a98rgb.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Convert an array of a98-rgb values in the range 0.0 - 1.0
* to linear light (un-companded) form. Negative values are also now accepted
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*/
export declare function lin_a98rgb(RGB: Color): Color;
11 changes: 11 additions & 0 deletions packages/color-helpers/dist/conversions/lin-p3-to-xyz.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Convert an array of linear-light display-p3 values to CIE XYZ
* using D65 (no chromatic adaptation)
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*
* @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
*/
export declare function lin_P3_to_XYZ(rgb: Color): Color;
9 changes: 9 additions & 0 deletions packages/color-helpers/dist/conversions/lin-p3.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Convert an array of display-p3 RGB values in the range 0.0 - 1.0
* to linear light (un-companded) form.
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*/
export declare function lin_P3(RGB: Color): Color;
11 changes: 11 additions & 0 deletions packages/color-helpers/dist/conversions/lin-pro-photo-to-xyz.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Convert an array of linear-light prophoto-rgb values to CIE XYZ
* using D50 (so no chromatic adaptation needed afterwards)
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*
* @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
*/
export declare function lin_ProPhoto_to_XYZ(rgb: Color): Color;
10 changes: 10 additions & 0 deletions packages/color-helpers/dist/conversions/lin-pro-photo.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Convert an array of prophoto-rgb values where in-gamut Colors are in the
* range [0.0 - 1.0] to linear light (un-companded) form. Transfer curve is
* gamma 1.8 with a small linear portion. Extended transfer function
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*/
export declare function lin_ProPhoto(RGB: Color): Color;
9 changes: 9 additions & 0 deletions packages/color-helpers/dist/conversions/lin-srgb-to-xyz.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Convert an array of linear-light sRGB values to CIE XYZ
* using sRGB's own white, D65 (no chromatic adaptation)
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*/
export declare function lin_sRGB_to_XYZ(rgb: Color): Color;
14 changes: 14 additions & 0 deletions packages/color-helpers/dist/conversions/lin-srgb.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* Convert an array of of sRGB values where in-gamut values are in the range
* [0 - 1] to linear light (un-companded) form.
* Extended transfer function:
* For negative values, linear portion is extended on reflection of axis,
* then reflected power function is used.
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*
* @see https://en.wikipedia.org/wiki/SRGB
*/
export declare function lin_sRGB(RGB: Color): Color;
13 changes: 13 additions & 0 deletions packages/color-helpers/dist/conversions/naive-cmyk-to-srgb.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* CMYK is an array of four values in the range [0.0, 1.0] the output is an
* array of [RGB] also in the [0.0, 1.0] range because the naive algorithm
* does not generate out of gamut colors neither does it generate accurate
* simulations of practical CMYK colors
*
* @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*
* @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
*
* @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js
*/
export declare function naive_CMYK_to_sRGB(CMYK: [number, number, number, number]): Color;
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.