Class HctSolver

java.lang.Object
org.glavo.monetfx.internal.hct.HctSolver

public class HctSolver extends Object
A class that solves the HCT equation.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Cam16
    solveToCam(double hueDegrees, double chroma, double lstar)
    Finds an sRGB color with the given hue, chroma, and L*, if possible.
    static int
    solveToInt(double hueDegrees, double chroma, double lstar)
    Finds an sRGB color with the given hue, chroma, and L*, if possible.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • solveToInt

      public static int solveToInt(double hueDegrees, double chroma, double lstar)
      Finds an sRGB color with the given hue, chroma, and L*, if possible.
      Parameters:
      hueDegrees - The desired hue, in degrees.
      chroma - The desired chroma.
      lstar - The desired L*.
      Returns:
      A hexadecimal representing the sRGB color. The color has sufficiently close hue, chroma, and L* to the desired values, if possible; otherwise, the hue and L* will be sufficiently close, and chroma will be maximized.
    • solveToCam

      public static Cam16 solveToCam(double hueDegrees, double chroma, double lstar)
      Finds an sRGB color with the given hue, chroma, and L*, if possible.
      Parameters:
      hueDegrees - The desired hue, in degrees.
      chroma - The desired chroma.
      lstar - The desired L*.
      Returns:
      A CAM16 object representing the sRGB color. The color has sufficiently close hue, chroma, and L* to the desired values, if possible; otherwise, the hue and L* will be sufficiently close, and chroma will be maximized.