Package org.scilab.forge.jlatexmath
Class TeXColor
java.lang.Object
org.scilab.forge.jlatexmath.TeXColor
An immutable sRGB color with an alpha, 8 bits each. It has what the library
used of
java.awt.Color, with the same results: the constants, the
constructors with integers (0 to 255) and with floats (0 to 1, rounded as AWT
does), and decode(String).-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
BLACK
-
WHITE
-
RED
-
GREEN
-
BLUE
-
CYAN
-
MAGENTA
-
YELLOW
-
-
Constructor Details
-
TeXColor
public TeXColor(int r, int g, int b) -
TeXColor
public TeXColor(int r, int g, int b, int a) - Throws:
IllegalArgumentException- if a component is not between 0 and 255
-
TeXColor
public TeXColor(float r, float g, float b) -
TeXColor
public TeXColor(float r, float g, float b, float a) - Throws:
IllegalArgumentException- if a component is not between 0 and 1
-
-
Method Details
-
decode
Converts "#RRGGBB", "0xRRGGBB" or a decimal number.- Throws:
NumberFormatException- if the string is not a number
-
getRed
public int getRed() -
getGreen
public int getGreen() -
getBlue
public int getBlue() -
getAlpha
public int getAlpha() -
equals
-
hashCode
public int hashCode() -
toString
-