Class TonalPalette.KeyColor

  • Enclosing class:
    TonalPalette

    private static final class TonalPalette.KeyColor
    extends java.lang.Object
    Key color is a color that represents the hue and chroma of a tonal palette.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.Integer,​java.lang.Double> chromaCache  
      private double hue  
      private static double MAX_CHROMA_VALUE  
      private double requestedChroma  
    • Constructor Summary

      Constructors 
      Constructor Description
      KeyColor​(double hue, double requestedChroma)
      Key color is a color that represents the hue and chroma of a tonal palette
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Hct create()
      Creates a key color from a [hue] and a [chroma].
      private double maxChroma​(int tone)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • hue

        private final double hue
      • requestedChroma

        private final double requestedChroma
      • chromaCache

        private final java.util.Map<java.lang.Integer,​java.lang.Double> chromaCache
    • Constructor Detail

      • KeyColor

        public KeyColor​(double hue,
                        double requestedChroma)
        Key color is a color that represents the hue and chroma of a tonal palette
    • Method Detail

      • create

        public Hct create()
        Creates a key color from a [hue] and a [chroma]. The key color is the first tone, starting from T50, matching the given hue and chroma.
        Returns:
        Key color [Hct]
      • maxChroma

        private double maxChroma​(int tone)