public class RawColor extends Object
Modifier and Type | Field and Description |
---|---|
int |
background |
int |
blue |
int |
col |
int |
green |
double |
hue |
static Comparator<RawColor> |
hueComparator
Comparator by hue value
|
(package private) Orientation |
orientation |
int |
red |
int |
row |
double |
saturation |
double |
value |
static Comparator<RawColor> |
whiteComparator
Comparator by white distance
|
int |
whiteDistance |
Constructor and Description |
---|
RawColor(Orientation orientation,
int row,
int col,
int[] rawColor)
Create new raw color from RGB sample
|
Modifier and Type | Method and Description |
---|---|
private static int |
calcRgbDistance(int[] rgb1,
int[] rgb2)
Calculate distance between two colors represented as RGB
|
private static double[] |
rgbToHsv(int[] rgb)
Convert RGB color to HSV representation
|
Orientation orientation
public int row
public int col
public int red
public int green
public int blue
public int background
public double hue
public double saturation
public double value
public int whiteDistance
public static Comparator<RawColor> whiteComparator
public static Comparator<RawColor> hueComparator
public RawColor(Orientation orientation, int row, int col, int[] rawColor)
orientation
- Current cube orientation which the color belongs torow
- Row of the colorcol
- Column of the colorrawColor
- Raw RGB readingprivate static int calcRgbDistance(int[] rgb1, int[] rgb2)
rgb1
- 1st colorrgb2
- 2nd colorprivate static double[] rgbToHsv(int[] rgb)
rgb
- RGB color reading