|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vaadin.sass.internal.util.ColorUtil
public class ColorUtil
| Constructor Summary | |
|---|---|
ColorUtil()
|
|
| Method Summary | |
|---|---|
static float[] |
colorToHsl(LexicalUnitImpl color)
Converts a color into an array of its HSL (hue, saturation, lightness) components. |
static int[] |
colorToRgb(LexicalUnitImpl color)
Converts a color into an array of its RGB components. |
static LexicalUnitImpl |
createHexColor(int[] rgb,
int line,
int column)
|
static LexicalUnitImpl |
createHexColor(int red,
int green,
int blue,
int line,
int column)
|
static LexicalUnitImpl |
createHslaColor(float hue,
float saturation,
float lightness,
float alpha,
int line,
int column)
|
static LexicalUnitImpl |
createHslaOrHslColor(float[] hsl,
float alpha,
int line,
int column)
|
static LexicalUnitImpl |
createRgbaColor(int red,
int green,
int blue,
float alpha,
int line,
int column)
|
static LexicalUnitImpl |
createRgbaOrHexColor(int[] rgb,
float alpha,
int line,
int column)
Creates a hex color if alpha is equal to one. |
static LexicalUnitImpl |
darken(LexicalUnitImpl color,
float amount)
|
static float |
getAlpha(LexicalUnitImpl color)
Returns the alpha component of the color. |
static int[] |
hslToRgb(float[] hsl)
Converts an array of HSL components to a string representing the color. |
static boolean |
isColor(LexicalUnitImpl unit)
Returns true if the lexical unit represents a valid color (hexadecimal, rgb(), color name etc.), false otherwise. |
static boolean |
isColorName(LexicalUnitImpl unit)
Returns true if the lexical unit represents a valid color name, false otherwise. |
static boolean |
isHexColor(LexicalUnitImpl unit)
Returns true if the lexical unit represents a valid color in the hexadecimal form (three or six digits), false otherwise. |
static boolean |
isHexColor(String string)
Returns true if the string represents a valid color in the hexadecimal form (three or six digits), false otherwise. |
static boolean |
isHsla(LexicalUnitImpl unit)
Returns true if the lexical unit represents a valid HSLA value, false otherwise. |
static boolean |
isHslColor(LexicalUnitImpl unit)
Returns true if the lexical unit represents a valid hsl() color function call, false otherwise. |
static boolean |
isRgba(LexicalUnitImpl unit)
Returns true if the lexical unit represents a valid RGBA value, false otherwise. |
static boolean |
isRgbFunction(LexicalUnitImpl unit)
Returns true if the lexical unit represents a valid rgb() method call , false otherwise. |
static LexicalUnitImpl |
lighten(LexicalUnitImpl color,
float amount)
|
static String |
rgbToColorString(int[] rgb)
Converts an array of RGB components to a string representing the color. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ColorUtil()
| Method Detail |
|---|
public static boolean isColor(LexicalUnitImpl unit)
unit - lexical unit
public static boolean isRgbFunction(LexicalUnitImpl unit)
unit - lexical unit
public static boolean isRgba(LexicalUnitImpl unit)
unit - lexical unit
public static boolean isHsla(LexicalUnitImpl unit)
unit - lexical unit
public static boolean isHexColor(LexicalUnitImpl unit)
unit - lexical unit
public static boolean isColorName(LexicalUnitImpl unit)
unit - lexical unit
public static boolean isHslColor(LexicalUnitImpl unit)
unit - lexical unit
public static float getAlpha(LexicalUnitImpl color)
color - An object representing a valid color.
public static int[] colorToRgb(LexicalUnitImpl color)
color - a lexical unit that represents a color
public static String rgbToColorString(int[] rgb)
rgb - the RGB components of a color
public static int[] hslToRgb(float[] hsl)
hsl - the HSL components of a color
public static float[] colorToHsl(LexicalUnitImpl color)
color - a lexical unit that represents a color
public static boolean isHexColor(String string)
string - string that might represent a hex color
public static LexicalUnitImpl createHexColor(int red,
int green,
int blue,
int line,
int column)
public static LexicalUnitImpl createHexColor(int[] rgb,
int line,
int column)
public static LexicalUnitImpl createRgbaColor(int red,
int green,
int blue,
float alpha,
int line,
int column)
public static LexicalUnitImpl createHslaColor(float hue,
float saturation,
float lightness,
float alpha,
int line,
int column)
public static LexicalUnitImpl createHslaOrHslColor(float[] hsl,
float alpha,
int line,
int column)
public static LexicalUnitImpl createRgbaOrHexColor(int[] rgb,
float alpha,
int line,
int column)
public static LexicalUnitImpl darken(LexicalUnitImpl color,
float amount)
public static LexicalUnitImpl lighten(LexicalUnitImpl color,
float amount)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||