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)
Returns a string representation of an object.
StaticcontrastAlgorithm to use as well as any other options to pass to the contrast function
StaticcontrastAPCANot symmetric, requires a foreground (text) color, and a background color
StaticcontrastStaticcontrastStaticcontrastStaticcontrastWCAG21StaticcontrastStaticdarkenStaticdeltaEOptionalo: deltaE method to use as well as any other options to pass to the deltaE function
StaticdeltaOptionalkC?: numberOptionalkH?: numberOptionalkL?: numberStaticdeltaStaticdeltaECMCOptionalc?: numberOptionall?: numberStaticdeltaEITPDelta E in ICtCp space, which the ITU calls Delta E ITP, which is shorter. Formulae from ITU Rec. ITU-R BT.2124-0
StaticdeltaEJzMore 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.
StaticdeltaEMethodsOptionalkC?: numberOptionalkH?: numberOptionalkL?: numberOptionalc?: numberOptionall?: 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)."
StaticdeltaEOKMore accurate color-difference formulae than the simple 1976 Euclidean distance in CIE Lab
StaticlightenStaticrangeCreates 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)
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)
Optionaloptions: RangeOptionsOptionaloptions: RangeOptions & Record<string, any>Create color mixtures in any desired proportion between two colors
Optionaloptions: RangeOptionsOptionaloptions: RangeOptionsGet an array of discrete steps
Optionaloptions: StepsOptionsOptionaloptions: ToGamutOptionsOptionalspace: stringStaticdefineStaticdefineStaticextendStaticgetOptionaloptions: ParseOptionsStaticmixCreate color mixtures in any desired proportion between two colors
Optionaloptions: RangeOptionsOptionaloptions: RangeOptionsStaticstepsGet an array of discrete steps
Optionaloptions: StepsOptionsOptionaloptions: StepsOptionsStatictryOptionaloptions: TryColorOptions
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.