Class Hct

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

public final class Hct extends Object
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 Details

    • from

      public static Hct from(double hue, double chroma, double tone)
      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

      public static Hct fromInt(int argb)
      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

      public static Hct fromFx(javafx.scene.paint.Color color)
    • getHue

      public double getHue()
    • getChroma

      public double getChroma()
    • getTone

      public double getTone()
    • toInt

      public int toInt()
    • inViewingConditions

      public Hct inViewingConditions(ViewingConditions vc)
      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

      public String toString()
      Overrides:
      toString in class Object