Class HctSolver
java.lang.Object
org.glavo.monetfx.internal.hct.HctSolver
A class that solves the HCT equation.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Cam16solveToCam(double hueDegrees, double chroma, double lstar) Finds an sRGB color with the given hue, chroma, and L*, if possible.static intsolveToInt(double hueDegrees, double chroma, double lstar) Finds an sRGB color with the given hue, chroma, and L*, if possible.
-
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
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.
-