allc
Version:
A small typescript package for color conversion.
39 lines (38 loc) • 1.94 kB
JavaScript
// This file was automatically generated by `src-comptime/precalculate.ts`.
import { MATRIX_LINEAR_DCI_P3_FROM_CIE_1931_XYZ_0_0, MATRIX_LINEAR_DCI_P3_FROM_CIE_1931_XYZ_0_1, MATRIX_LINEAR_DCI_P3_FROM_CIE_1931_XYZ_0_2, MATRIX_LINEAR_DCI_P3_FROM_CIE_1931_XYZ_1_0, MATRIX_LINEAR_DCI_P3_FROM_CIE_1931_XYZ_1_1, MATRIX_LINEAR_DCI_P3_FROM_CIE_1931_XYZ_1_2, MATRIX_LINEAR_DCI_P3_FROM_CIE_1931_XYZ_2_0, MATRIX_LINEAR_DCI_P3_FROM_CIE_1931_XYZ_2_1, MATRIX_LINEAR_DCI_P3_FROM_CIE_1931_XYZ_2_2, } from "../../matrices";
/**
* Calculates the red component of linear DCI-P3 from CIE 1931 XYZ.
*
* @param x The X component of CIE 1931 XYZ.
* @param y The Y component of CIE 1931 XYZ.
* @param z The Z component of CIE 1931 XYZ.
*
* @returns The red component of linear DCI-P3.
*/
export const toLinearDCIP3RFromCIE1931XYZ = (x, y, z) => x * MATRIX_LINEAR_DCI_P3_FROM_CIE_1931_XYZ_0_0
+ y * MATRIX_LINEAR_DCI_P3_FROM_CIE_1931_XYZ_0_1
+ z * MATRIX_LINEAR_DCI_P3_FROM_CIE_1931_XYZ_0_2;
/**
* Calculates the green component of linear DCI-P3 from CIE 1931 XYZ.
*
* @param x The X component of CIE 1931 XYZ.
* @param y The Y component of CIE 1931 XYZ.
* @param z The Z component of CIE 1931 XYZ.
*
* @returns The green component of linear DCI-P3.
*/
export const toLinearDCIP3GFromCIE1931XYZ = (x, y, z) => x * MATRIX_LINEAR_DCI_P3_FROM_CIE_1931_XYZ_1_0
+ y * MATRIX_LINEAR_DCI_P3_FROM_CIE_1931_XYZ_1_1
+ z * MATRIX_LINEAR_DCI_P3_FROM_CIE_1931_XYZ_1_2;
/**
* Calculates the blue component of linear DCI-P3 from CIE 1931 XYZ.
*
* @param x The X component of CIE 1931 XYZ.
* @param y The Y component of CIE 1931 XYZ.
* @param z The Z component of CIE 1931 XYZ.
*
* @returns The blue component of linear DCI-P3.
*/
export const toLinearDCIP3BFromCIE1931XYZ = (x, y, z) => x * MATRIX_LINEAR_DCI_P3_FROM_CIE_1931_XYZ_2_0
+ y * MATRIX_LINEAR_DCI_P3_FROM_CIE_1931_XYZ_2_1
+ z * MATRIX_LINEAR_DCI_P3_FROM_CIE_1931_XYZ_2_2;