Class Color
java.lang.Object
de.xima.fc.common.graphdot.Color
- All Implemented Interfaces:
Serializable, CharSequence
A single color for graphviz.
indianred #ff0033 0.345,0.500.0.250
- Since:
- 8.2.0
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionColor(CharSequence color) Creates a new color with the given representation. -
Method Summary
Modifier and TypeMethodDescriptiondefault charcharAt(int index) default IntStreamchars()default IntStreamstatic Colorcustom(CharSequence color) Creates a custom color.final booleanfinal inthashCode()static Colorhsv(double hue, double saturation, double value) Creates an HSV color.static Colorhsv(long hsv) Creates an HSV color.static Colorhsv(long hue, long saturation, long value) Creates an HSV color.static Colorhsva(double hue, double saturation, double value, double alpha) Creates an HSVA color.static Colorhsva(long hsva) Creates an HSVA color.static Colorhsva(long hue, long saturation, long value, long alpha) Creates an HSVA color.default intlength()static Colorrgb(double red, double green, double blue) Creates an RGB color.static Colorrgb(long rgb) Creates an RGB color.static Colorrgb(long red, long green, long blue) Creates an RGB color.static Colorrgba(double red, double green, double blue, double alpha) Creates an RGBA color.static Colorrgba(long rgba) Creates an RGBA color.static Colorrgba(long rgb, double alpha) Creates a new color from the given RGB pair and with the given alpha value.static Colorrgba(long red, long green, long blue, long alpha) Creates an RGBA color.default CharSequencesubSequence(int start, int end) static Colorsvg(EColorSchemeSvg color) Uses a color from the SVG color scheme.toString()static Colorx11(EColorSchemeX11 color) Uses a color from the X11 color scheme.
-
Constructor Details
-
Color
Creates a new color with the given representation. Use static factory methods for better semantics.- Parameters:
color- String representation of the color.
-
-
Method Details
-
toString
- Specified by:
toStringin interfaceCharSequence
-
custom
Creates a custom color.- Parameters:
color- Custom color.- Returns:
- A color with the given text.
-
hsv
Creates an HSV color.- Parameters:
hue- Hue part of the color, in the range [0, 1].saturation- Saturation part of the color, in the range [0, 1].value- Value part of the color, in the range [0, 1].- Returns:
- A color with the given values.
-
hsv
Creates an HSV color.- Parameters:
hsv- HSV value of the color, use0x......number literals!- Returns:
- A color with the given values.
-
hsv
Creates an HSV color.- Parameters:
hue- Hue part of the color, in the range [0, 255].saturation- Saturation part of the color, in the range [0, 255].value- Value part of the color, in the range [0, 255].- Returns:
- A color with the given values.
-
hsva
Creates an HSVA color.- Parameters:
hue- Hue part of the color, in the range [0, 1].saturation- Saturation part of the color, in the range [0, 1].value- Value part of the color, in the range [0, 1].alpha- Alpha part of the color, in the range [0, 1].- Returns:
- A color with the given values.
-
hsva
Creates an HSVA color.- Parameters:
hsva- HSVA value of the color, use0x......number literals!- Returns:
- A color with the given values.
-
hsva
Creates an HSVA color.- Parameters:
hue- Hue part of the color, in the range [0, 255].saturation- Saturation part of the color, in the range [0, 255].value- Value part of the color, in the range [0, 255].alpha- Alpha part of the color, in the range [0, 255].- Returns:
- A color with the given values.
-
rgb
Creates an RGB color.- Parameters:
red- Red part of the color, in the range [0, 1].green- Green part of the color, in the range [0, 1].blue- Blue part of the color, in the range [0, 1].- Returns:
- A color with the given values.
-
rgb
Creates an RGB color.- Parameters:
rgb- RGB value of the color, use0x......number literals!- Returns:
- A color with the given values.
-
rgb
Creates an RGB color.- Parameters:
red- Red part of the color, in the range [0, 255].green- Green part of the color, in the range [0, 255].blue- Blue part of the color, in the range [0, 255].- Returns:
- A color with the given values.
-
rgba
Creates an RGBA color.- Parameters:
red- Red part of the color, in the range [0, 1].green- Green part of the color, in the range [0, 1].blue- Blue part of the color, in the range [0, 1].alpha- Alpha part of the color, in the range [0, 1].- Returns:
- A color with the given values.
-
rgba
Creates an RGBA color.- Parameters:
rgba- RGBA value of the color, use0x......number literals!- Returns:
- A color with the given values.
-
rgba
Creates an RGBA color.- Parameters:
red- Red part of the color, in the range [0, 255].green- Green part of the color, in the range [0, 255].blue- Blue part of the color, in the range [0, 255].alpha- Alpha part of the color, in the range [0, 255].- Returns:
- A color with the given values.
-
svg
Uses a color from the SVG color scheme.- Parameters:
color- Color to use.- Returns:
- A color with the given values.
-
x11
Uses a color from the X11 color scheme.- Parameters:
color- Color to use.- Returns:
- A color with the given values.
-
rgba
Creates a new color from the given RGB pair and with the given alpha value.- Parameters:
rgb- RGB part of the color, e.g. 0xFF337F.alpha- Alpha part of the color, in the range [0, 255].- Returns:
- A color with the given values.
-
equals
-
hashCode
-
charAt
default char charAt(int index) - Specified by:
charAtin interfaceCharSequence
-
chars
- Specified by:
charsin interfaceCharSequence
-
codePoints
- Specified by:
codePointsin interfaceCharSequence
-
length
default int length()- Specified by:
lengthin interfaceCharSequence
-
subSequence
- Specified by:
subSequencein interfaceCharSequence
-