Class Blend
java.lang.Object
org.glavo.monetfx.internal.blend.Blend
Functions for blending in HCT and CAM16.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intcam16Ucs(int from, int to, double amount) Blend in CAM16-UCS space.static intharmonize(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 inthctHue(int from, int to, double amount) Blends hue from one color into another.
-
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 colorto- ARGB representation of coloramount- 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 colorto- ARGB representation of coloramount- how much blending to perform; 0.0 >= and invalid input: '<'= 1.0- Returns:
- from, blended towards to. Hue, chroma, and tone will change.
-