public class ColorRGB extends Object implements Serializable
It exists mainly to avoid AWT references to Color
.
Constructor and Description |
---|
ColorRGB(int red,
int green,
int blue) |
ColorRGB(String s)
Parses a color from the given string.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
static ColorRGB |
fromHSVColor(double h,
double s,
double v) |
static ColorRGB |
fromHTMLColor(String color)
Convert a string in the format specified by CSS Color Module Level 3 - W3C
Recommendation 07 June 2011 to a
ColorRGB object. |
int |
getAlpha() |
int |
getARGB()
Gets the color as a packed integer, 8 bits per color component.
|
int |
getBlue() |
int |
getGreen() |
int |
getRed() |
int |
hashCode() |
String |
toHTMLColor()
Convert this ColorRGB to a string in the format specified by CSS Color Module Level 3 - W3C
Recommendation 07 June 2011.
|
String |
toString() |
public ColorRGB(int red, int green, int blue)
public ColorRGB(String s)
#
), as handled by
fromHTMLColor(String)
.Colors.getColor(String)
.r,g,b
, with each element in the
range [0, 255]
.public int getRed()
public int getGreen()
public int getBlue()
public int getAlpha()
public int getARGB()
public String toHTMLColor()
We preferentially encode using one of the colors in the table and fall back to the hex encoding.
public static ColorRGB fromHTMLColor(String color)
ColorRGB
object.color
- The color string to convert.public static ColorRGB fromHSVColor(double h, double s, double v)
Copyright © 2015–2022 SciJava. All rights reserved.