Companion

public class Companion

Properties

Link copied to clipboard
public final static ColorUtils.Companion INSTANCE

Functions

Link copied to clipboard
public final DoubleArray adaptXyz(@Size(value = 3) DoubleArray xyzIn, @Size(value = 3) DoubleArray refIn, @Size(value = 3) DoubleArray refOut)

Adapts colour in XYZ from one reference white to another using Bradford adaptation method. NOTE: refIn, refOut, xyzIn must all be on the same scale

Link copied to clipboard
public final DoubleArray clipXyz(@Size(value = 3) DoubleArray xyz, @Size(value = 3) DoubleArray xyzRef)

Clips CIEXYZ values in between 0 and the value of the reference white to ensure X,Y,Z are in the proper range.

Link copied to clipboard
public final DoubleArray cmykToXyz(Context context, @Size(value = 4) DoubleArray cmykIn, @Size(value = 3) DoubleArray refOut, Boolean bpc)

Calculates XYZ value from CMYK input using built-in lookup tables

public final DoubleArray cmykToXyz(@Size(value = 4) DoubleArray cmykIn, @Size(value = 3) DoubleArray refOut, Boolean bpc, Array<DoubleArray> m, Array<IntArray> input, Array<IntArray> clut, Array<IntArray> output)

Calculates XYZ value from CMYK input using lookup tables provided as input arguments

Link copied to clipboard
public final Double deltaE00(@Size(value = 3) DoubleArray lab1, @Size(value = 3) DoubleArray lab2, Double kL, Double kC, Double kH)

Takes two CIELAB values and calculates color difference (dE) using CIE2000 formula NOTE: both CIELAB values must share the same reference white. If they do not: convert to XYZ, adapt, convert back to CIELAB before calculating dE.

Link copied to clipboard
public final Double deltaE76(@Size(value = 3) DoubleArray lab1, @Size(value = 3) DoubleArray lab2)

Takes two CIELAB values and calculates color difference (dE) using CIE1976 formula. NOTE: both CIELAB values must share the same reference white. If they do not: convert to XYZ, adapt, convert back to CIELAB before calculating dE

Link copied to clipboard
public final Double deltaE94(@Size(value = 3) DoubleArray lab1, @Size(value = 3) DoubleArray lab2, Double kL, Double k1, Double k2)

Takes two CIELAB values and calculates color difference (dE) using CIE1994 formula. Requires weighting factors kL, k1, and k2 which are dependent on application. Use the deltaE94G method for graphic design applications and the deltaE94T for textile applications. NOTE: both CIELAB values must share the same reference white. If they do not: convert to XYZ, adapt, convert back to CIELAB before calculating dE.

Link copied to clipboard
public final Double deltaE94G(@Size(value = 3) DoubleArray lab1, @Size(value = 3) DoubleArray lab2)

Takes two CIELAB values and calculates color difference (dE) using CIE1994 formula for the graphic design application (kL = 1, k1 = 0.045, k2 = 0.015). NOTE: both CIELAB values must share the same reference white. If they do not: convert to XYZ, adapt, convert back to CIELAB before calculating dE.

Link copied to clipboard
public final Double deltaE94T(@Size(value = 3) DoubleArray lab1, @Size(value = 3) DoubleArray lab2)

Takes two CIELAB values and calculates color difference (dE) using CIE1994 formula for the textiles application (kL = 2, k1 = 0.048, k2 = 0.014). NOTE: both CIELAB values must share the same reference white. If they do not: convert to XYZ, adapt, convert back to CIELAB before calculating dE.

Link copied to clipboard
public final Double deltaECmc(@Size(value = 3) DoubleArray lab1, @Size(value = 3) DoubleArray lab2, Double l, Double c)

Takes two CIELAB values and calculates color difference (dE) using CMC(l:c) formula. Depends on model parameters l and c; common values used are CMC(2:1) for acceptability and CMC(1:1) for perceptibility. NOTE: both CIELAB values must share the same reference white. If they do not: convert to XYZ, adapt, convert back to CIELAB before calculating dE

Link copied to clipboard
public final DoubleArray labToLch(@Size(value = 3) DoubleArray labIn)

Takes CIELAB value and converts to polar coordinates (LCH)

Link copied to clipboard
public final DoubleArray labToXyz(@Size(value = 3) DoubleArray lab, @Size(value = 3) DoubleArray xyzRef)

Takes CIELAB value and its reference white to calculate CIEXYZ value

Link copied to clipboard
public final DoubleArray lchToLab(@Size(value = 3) DoubleArray lchIn)

Takes LCHab value and converts to CIELAB

Link copied to clipboard
public final DoubleArray lchToLuv(@Size(value = 3) DoubleArray lchIn)

Takes LCHuv value and converts to CIELUV

Link copied to clipboard
public final DoubleArray luvToLch(@Size(value = 3) DoubleArray luvIn)

Takes CIELUV value and converts to polar coordinates (LCH)

Link copied to clipboard
public final DoubleArray luvToXyz(@Size(value = 3) DoubleArray luvIn, @Size(value = 3) DoubleArray xyzRef)

Takes CIELUV value and its reference white to calculate CIEXYZ value

Link copied to clipboard
public final DoubleArray rgbToXyz(@Size(value = 3) DoubleArray rgbIn, @Size(value = 2) DoubleArray redChromaticity, @Size(value = 2) DoubleArray greenChromaticity, @Size(value = 2) DoubleArray blueChromaticity, @Size(value = 2) DoubleArray whiteChromaticity, @Size(value = 3) DoubleArray refOut)

Calculates XYZ from linear RGB given chromaticity coordinates of RGB working space primaries and reference whites of RGB and XYZ value.

Link copied to clipboard
public final DoubleArray spectral10ToDensity(IntArray lambda, FloatArray reflectance, DensityStatus status)

Takes reflectance data on 10 nm intervals and calculates CMYK densities according to ISO 5-3:2009. Data must be provided on 10 nm intervals corresponding to the nearest 10 nanometer. Density values are calculated across the range 340 - 770 nm. If the provided data spans a shorter range (eg - 400 - 700 nm), the values at the boundaries are repeated.

Link copied to clipboard
public final DoubleArray spectral10ToXyz(IntArray lambda, FloatArray reflectance, Illuminant illuminant, Observer observer)

Takes reflectance data on 10 nm intervals and calculates a CIEXYZ value according to ASTM E308. Data must be provided on 10 nm intervals corresponding to the nearest 10 nanometer. CIEXYZ values are calculated across the range 360 - 780 nm. If the provided data spans a shorter range (eg - 400 - 700 nm), the values at the boundaries are repeated.

Link copied to clipboard
public final DoubleArray sRgbToXyz(@Size(value = 3) IntArray sRgb, @Size(value = 3) DoubleArray refOut)

Calculates XYZ from sRGB value.

Link copied to clipboard
public final DoubleArray xyzToCmyk(Context context, @Size(value = 3) DoubleArray xyzIn, @Size(value = 3) DoubleArray xyzRef, Boolean bpc)

Calculates CMYK value from XYZ input using built in lookup tables

public final DoubleArray xyzToCmyk(@Size(value = 3) DoubleArray xyzIn, @Size(value = 3) DoubleArray xyzRef, Boolean bpc, Array<DoubleArray> m, Array<IntArray> inputCurves, Array<IntArray> clut, Array<IntArray> outputCurves)

Calculates CMYK value from XYZ using lookup tables provided as inputCurves arguments

Link copied to clipboard
public final DoubleArray xyzToLab(@Size(value = 3) DoubleArray xyz, @Size(value = 3) DoubleArray xyzRef)

Takes CIEXYZ value and its reference white to calculate CIELAB value. xyz and xyzRef can be either unity (0 - 1) or scaled (0 - 100) input, but both vectors must be the same scale. (IE - if xyz is unity scale, xyzRef must also be unity scale)

Link copied to clipboard
public final DoubleArray xyzToLuv(@Size(value = 3) DoubleArray xyzIn, @Size(value = 3) DoubleArray xyzRef)

Takes CIEXYZ value and its reference white to calculate CIELUV value.

Link copied to clipboard
public final DoubleArray xyzToRgb(@Size(value = 3) DoubleArray xyzIn, @Size(value = 3) DoubleArray refIn, @Size(value = 2) DoubleArray redChromaticity, @Size(value = 2) DoubleArray greenChromaticity, @Size(value = 2) DoubleArray blueChromaticity, @Size(value = 2) DoubleArray whiteChromaticity)

Calculates linear RGB from XYZ given chromaticity coordinates of RGB working space primaries and reference whites of RGB and XYZ value

Link copied to clipboard
public final IntArray xyzToSrgb(@Size(value = 3) DoubleArray xyzIn, @Size(value = 3) DoubleArray refIn)

Calculates companded sRGB value from XYZ given reference white of XYZ value.