Class Blend

java.lang.Object
org.glavo.monetfx.internal.blend.Blend

public class Blend extends Object
Functions for blending in HCT and CAM16.
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    cam16Ucs(int from, int to, double amount)
    Blend in CAM16-UCS space.
    static int
    harmonize(int designColor, int sourceColor)
    Blend the design color's HCT hue towards the key color's HCT hue, in a way that leaves the original color recognizable and recognizably shifted towards the key color.
    static int
    hctHue(int from, int to, double amount)
    Blends hue from one color into another.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • harmonize

      public static int harmonize(int designColor, int sourceColor)
      Blend the design color's HCT hue towards the key color's HCT hue, in a way that leaves the original color recognizable and recognizably shifted towards the key color.
      Parameters:
      designColor - ARGB representation of an arbitrary color.
      sourceColor - ARGB representation of the main theme color.
      Returns:
      The design color with a hue shifted towards the system's color, a slightly warmer/cooler variant of the design color's hue.
    • hctHue

      public static int hctHue(int from, int to, double amount)
      Blends hue from one color into another. The chroma and tone of the original color are maintained.
      Parameters:
      from - ARGB representation of color
      to - ARGB representation of color
      amount - how much blending to perform; 0.0 >= and invalid input: '<'= 1.0
      Returns:
      from, with a hue blended towards to. Chroma and tone are constant.
    • cam16Ucs

      public static int cam16Ucs(int from, int to, double amount)
      Blend in CAM16-UCS space.
      Parameters:
      from - ARGB representation of color
      to - ARGB representation of color
      amount - how much blending to perform; 0.0 >= and invalid input: '<'= 1.0
      Returns:
      from, blended towards to. Hue, chroma, and tone will change.