Class ContrastCurve

java.lang.Object
org.glavo.monetfx.internal.dynamiccolor.ContrastCurve

public final class ContrastCurve extends 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.

  • Constructor Summary

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

    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
  • Constructor Details

    • 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 Details

    • 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.