Rest
...args: [foreground: ColorTypes, o: "WCAG21" | "APCA" | "Michelson" | "Weber" | "Lstar" | "DeltaPhi" | { Rest
...args: [foreground: ColorTypes]Rest
...args: [color2: ColorTypes]Rest
...args: [color2: ColorTypes]Rest
...args: [color2: ColorTypes]Rest
...args: [color2: ColorTypes]Rest
...args: [color2: ColorTypes]Rest
...args: [amount: number]Rest
...args: [c2: ColorTypes, o: "76" | "Jz" | "HCT" | "CMC" | "2000" | "ITP" | "OK" | "OK2" | { Rest
...args: [sample: ColorTypes, { Rest
...args: [sample: ColorTypes]Rest
...args: [sample: ColorTypes, { Rest
...args: [sample: ColorTypes]Rest
...args: [sample: ColorTypes]Rest
...args: [sample: ColorTypes]Rest
...args: [color2: ColorTypes, space: string | Space]Rest
...args: [color2: ColorTypes]Rest
...args: [prop: Ref]Rest
...args: [space: string | Space, { Rest
...args: [amount: number]Creates a function that accepts a number and returns a color. For numbers in the range 0 to 1, the function interpolates; for numbers outside that range, the function extrapolates (and thus may not return the results you expect)
Rest
...args: [ColorTypes, (RangeOptions & Record<string, any>)?]Rest
...args: [space: string | Space, { Rest
...args: [options: SerializeOptions & Record<string, any>]Rest
...args: []Rest
...args: []Static
contrastAlgorithm to use as well as any other options to pass to the contrast function
Static
contrastAPCANot symmetric, requires a foreground (text) color, and a background color
Static
contrastStatic
contrastStatic
contrastStatic
contrastWCAG21Static
contrastStatic
darkenStatic
deltaEOptional
o: "76" | "Jz" | "HCT" | "CMC" | "2000" | "ITP" | "OK" | "OK2" | { deltaE method to use as well as any other options to pass to the deltaE function
Static
deltaOptional
kC?: numberOptional
kH?: numberOptional
kL?: numberStatic
deltaStatic
deltaECMCOptional
c?: numberOptional
l?: numberStatic
deltaEITPDelta E in ICtCp space, which the ITU calls Delta E ITP, which is shorter. Formulae from ITU Rec. ITU-R BT.2124-0
Static
deltaEJzMore accurate color-difference formulae than the simple 1976 Euclidean distance in Lab
Uses JzCzHz, which has improved perceptual uniformity and thus a simple Euclidean root-sum of ΔL² ΔC² ΔH² gives good results.
Static
deltaEMethodsOptional
kC?: numberOptional
kH?: numberOptional
kL?: numberOptional
c?: numberOptional
l?: numberColor distance using HCT.
Delta E in ICtCp space, which the ITU calls Delta E ITP, which is shorter. Formulae from ITU Rec. ITU-R BT.2124-0
More accurate color-difference formulae than the simple 1976 Euclidean distance in Lab
Uses JzCzHz, which has improved perceptual uniformity and thus a simple Euclidean root-sum of ΔL² ΔC² ΔH² gives good results.
More accurate color-difference formulae than the simple 1976 Euclidean distance in CIE Lab
More accurate color-difference formulae than the simple 1976 Euclidean distance in CIE Lab The Oklab a and b axes are scaled relative to the L axis, for better uniformity Björn Ottosson said: "I've recently done some tests with color distance datasets as implemented in Colorio and on both the Combvd dataset and the OSA-UCS dataset a scale factor of slightly more than 2 for a and b would give the best results (2.016 works best for Combvd and 2.045 for the OSA-UCS dataset)."
Static
deltaEOKMore accurate color-difference formulae than the simple 1976 Euclidean distance in CIE Lab
Static
lightenStatic
rangeCreates a function that accepts a number and returns a color. For numbers in the range 0 to 1, the function interpolates; for numbers outside that range, the function extrapolates (and thus may not return the results you expect)
Optional
options: RangeOptionsOptional
options: RangeOptions & Record<string, any>Create color mixtures in any desired proportion between two colors
Optional
options: RangeOptionsOptional
options: RangeOptionsGet an array of discrete steps
Optional
options: StepsOptionsOptional
options: ToGamutOptionsOptional
space: stringStatic
defineStatic
defineStatic
extendStatic
getStatic
mixCreate color mixtures in any desired proportion between two colors
Optional
options: RangeOptionsOptional
options: RangeOptionsStatic
stepsGet an array of discrete steps
Optional
options: StepsOptionsOptional
options: StepsOptions
Class that represents a single color. All of Color.js’s tree-shakeable methods are also available as instance methods on this class, as well as static methods that take the color as the first argument.