Class ContrastCurve


  • public final class ContrastCurve
    extends java.lang.Object
    A class containing a value that changes with the contrast level.

    Usually represents the contrast requirements for a dynamic color on its background. The four values correspond to values for contrast levels -1.0, 0.0, 0.5, and 1.0, respectively.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private double high
      Value for contrast level 1.0
      private double low
      Value for contrast level -1.0
      private double medium
      Value for contrast level 0.5
      private double normal
      Value for contrast level 0.0
    • Constructor Summary

      Constructors 
      Constructor Description
      ContrastCurve​(double low, double normal, double medium, double high)
      Creates a `ContrastCurve` object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double get​(double contrastLevel)
      Returns the value at a given contrast level.
      • Methods inherited from class java.lang.Object

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

      • low

        private final double low
        Value for contrast level -1.0
      • normal

        private final double normal
        Value for contrast level 0.0
      • medium

        private final double medium
        Value for contrast level 0.5
      • high

        private final double high
        Value for contrast level 1.0
    • Constructor Detail

      • ContrastCurve

        public ContrastCurve​(double low,
                             double normal,
                             double medium,
                             double high)
        Creates a `ContrastCurve` object.
        Parameters:
        low - Value for contrast level -1.0
        normal - Value for contrast level 0.0
        medium - Value for contrast level 0.5
        high - Value for contrast level 1.0
    • Method Detail

      • get

        public double get​(double contrastLevel)
        Returns the value at a given contrast level.
        Parameters:
        contrastLevel - The contrast level. 0.0 is the default (normal); -1.0 is the lowest; 1.0 is the highest.
        Returns:
        The value. For contrast ratios, a number between 1.0 and 21.0.