public class ColorUtils extends Object
| Constructor and Description |
|---|
ColorUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Color |
getColor(Color color,
float factor) |
static Color |
getSimiliarColor(Color color,
float factor) |
static Color |
getTranslucentColor(Color c,
int alpha) |
static Color |
HSVtoRGB(double[] data)
Returns the color object represented by the HSV.
|
static Color |
HSVtoRGB(double h,
double s,
double v)
Returns the color object represented by the HSV.
|
static Color[] |
mixColors(Color c)
Returns an array of 9 colors which one could use very good together.
|
static Color |
oposite(Color a) |
static double[] |
RGBtoHSV(Color c)
Returns the HSV representation of the RGB-Color.
|
static Color |
subtract(Color a,
Color b) |
static Color |
toColor(String str)
Can be:
(255, 0, 0)
255, 0, 0
#FF0000
#F00
red
|
static String |
toString(Color c) |
public static Color[] mixColors(Color c)
Returns an array of 9 colors which one could use very good together.
The code to calculate the colors is taken from Twyst
I've just translated it into Java.
c - The base Color (returned as index 0)public static Color HSVtoRGB(double[] data)
Returns the color object represented by the HSV.
The code is taken from Twyst
I've just translated it into Java.
data - An double[] with three items (0=h; s=1; 2=v)public static Color HSVtoRGB(double h, double s, double v)
Returns the color object represented by the HSV.
The code is taken from Twyst
I've just translated it into Java.
All values must be between 0 and 255!.
h - The "H"-value of the color.s - The "S"-value of the color.v - The "V"-value of the color.public static double[] RGBtoHSV(Color c)
Returns the HSV representation of the RGB-Color. All values are between 0 and 255.
The code is taken from Twyst
I've just translated it into Java.
c - The color to be translated to HSV.Copyright © 2015. All rights reserved.