Add XYZ colorspace to Color class
This commit is contained in:
parent
70f01a69c4
commit
9edea04d9c
1 changed files with 11 additions and 3 deletions
|
@ -105,6 +105,14 @@ public class Color {
|
|||
}
|
||||
|
||||
|
||||
public static Color xyz(double x, double y, double z) {
|
||||
double r = 3.2404542 * x - 1.5371385 * y - 0.4985314 * z;
|
||||
double g = -0.9692660 * x + 1.8760108 * y + 0.0415560 * z;
|
||||
double b = 0.0556434 * x - 0.2040259 * y + 1.0572252 * z;
|
||||
|
||||
return Color.rgb(r,g,b);
|
||||
}
|
||||
|
||||
public static Color code(int code) {
|
||||
return rgb(
|
||||
byteToValue((code >> 16) & 0xFF),
|
||||
|
|
Loading…
Add table
Reference in a new issue