Class Hct
java.lang.Object
org.glavo.monetfx.internal.hct.Hct
HCT, hue, chroma, and tone. A color system that provides a perceptually accurate color
measurement system that can also accurately render what colors will appear as in different
lighting environments.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Hctfrom(double hue, double chroma, double tone) Create an HCT color from hue, chroma, and tone.static HctfromFx(javafx.scene.paint.Color color) static HctfromInt(int argb) Create an HCT color from a color.doubledoublegetHue()doublegetTone()Translate a color into different ViewingConditions.inttoInt()toString()
-
Method Details
-
from
Create an HCT color from hue, chroma, and tone.- Parameters:
hue- 0 invalid input: '<'= hue invalid input: '<' 360; invalid values are corrected.chroma- 0 invalid input: '<'= chroma invalid input: '<' ?; Informally, colorfulness. The color returned may be lower than the requested chroma. Chroma has a different maximum for any given hue and tone.tone- 0 invalid input: '<'= tone invalid input: '<'= 100; invalid values are corrected.- Returns:
- HCT representation of a color in default viewing conditions.
-
fromInt
Create an HCT color from a color.- Parameters:
argb- ARGB representation of a color.- Returns:
- HCT representation of a color in default viewing conditions
-
fromFx
-
getHue
public double getHue() -
getChroma
public double getChroma() -
getTone
public double getTone() -
toInt
public int toInt() -
inViewingConditions
Translate a color into different ViewingConditions.Colors change appearance. They look different with lights on versus off, the same color, as in hex code, on white looks different when on black. This is called color relativity, most famously explicated by Josef Albers in Interaction of Color.
In color science, color appearance models can account for this and calculate the appearance of a color in different settings. HCT is based on CAM16, a color appearance model, and uses it to make these calculations.
See ViewingConditions.make for parameters affecting color appearance.
-
toString
-