public class Colorization extends Object
| Modifier and Type | Field and Description |
|---|---|
int |
colorizationId
Every colorization must have a unique id that can be used to
compare a particular colorization record with another.
|
float[] |
offsets
The adjustments to make to hue, saturation and value.
|
float[] |
range
The range around the root color that will be colorized (in
delta-hue, delta-saturation, delta-value.
|
Color |
rootColor
The root color for the colorization.
|
| Constructor and Description |
|---|
Colorization(int colorizationId,
Color rootColor,
float[] range,
float[] offsets)
Constructs a colorization record with the specified identifier.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
distance(int a,
int b,
int N)
Returns the distance between the supplied to numbers modulo N.
|
boolean |
equals(Object other) |
Color |
getColorizedRoot()
Returns the root color adjusted by the colorization.
|
int |
hashCode() |
boolean |
matches(float[] hsv,
int[] fhsv)
Returns true if this colorization matches the supplied color, false otherwise.
|
int |
recolorColor(float[] hsv)
Adjusts the supplied color by the offsets in this colorization, taking the appropriate
measures for hue (wrapping it around) and saturation and value (clipping).
|
static int[] |
toFixedHSV(float[] hsv,
int[] fhsv)
Converts floating point HSV values to a fixed point integer representation.
|
String |
toString() |
String |
toVerboseString()
Returns a long string representation of this colorization.
|
public int colorizationId
public Color rootColor
public float[] range
public float[] offsets
public Colorization(int colorizationId,
Color rootColor,
float[] range,
float[] offsets)
public Color getColorizedRoot()
public int recolorColor(float[] hsv)
public boolean matches(float[] hsv,
int[] fhsv)
hsv - the HSV values for the color in question.fhsv - the HSV values converted to fixed point via toFixedHSV(float[], int[]) for the color
in question.public String toVerboseString()
public static int[] toFixedHSV(float[] hsv,
int[] fhsv)
hsv - the HSV values to be converted.fhsv - the destination array into which the fixed values will be stored. If this is
null, a new array will be created of the appropriate length.fhsv parameter if it was non-null or the newly created target
array.public static int distance(int a,
int b,
int N)
Copyright © 2015. All rights reserved.