![]() |
Bridges-Java
3.4.4-dev2-4-g23cf54b
Bridges(Java API)
|
Public Member Functions | |
Color () | |
Color (int r, int g, int b, float a) | |
Color (int r, int g, int b) | |
Color (String color) | |
void | setColor (int r, int g, int b, float a) |
void | setRed (int r) |
int | getRed () |
void | setGreen (int g) |
int | getGreen () |
void | setBlue (int b) |
int | getBlue () |
void | setAlpha (float a) |
float | getAlpha () |
String | getRepresentation () |
String | getHexRepresentation () |
byte[] | getByteRepresentation () |
boolean | equals (Object obj) |
String | toString () |
void | setColor (String col_name) |
Static Public Member Functions | |
static Color | colorFromHex (String hexStr) throws IllegalArgumentException |
Static Package Functions | |
[static initializer] | |
Package Attributes | |
int | green |
int | blue |
@brief This class is used to represent colors in BRIDGES. We use an RGBA model to represent colors, with each component in the range 0-255. BRIDGES also supports named colors for user convenience, but these are converted into [RGBA] prior to transmission to the server for visualization. <p>
Supported named colors are listed below and here: https://drafts.csswg.org/css-color-3/#svg-color
aliceblue, antiquewhite, cyan, aquamarine, azure, beige, bisque, black, blanchedalmond, blue, blueviolet, brown, burlywood, cadetblue, chartreuse, chocolate, coral, cornflowerblue, cornsilk, crimson, darkblue, darkcyan, darkgoldenrod, darkgrey, darkgreen, darkkhaki, darkmagenta, darkolivegreen, darkorange, darkorchid, darkred, darksalmon, darkseagreen, darkslateblue, darkslategrey, darkturquoise, darkviolet, deeppink, deepskyblue, dimgrey, dodgerblue, firebrick, floralwhite, forestgreen, magenta, gainsboro, ghostwhite, gold, goldenrod, grey, green, greenyellow, honeydew, hotpink, indianred, indigo, ivory, khaki, lavender, lavenderblush, lawngreen, lemonchiffon, lightblue, lightcoral, lightcyan, lightgoldenrodyellow, lightgrey, lightgreen, lightpink, lightsalmon, lightseagreen, lightskyblue, lightslategrey, lightsteelblue, lightyellow, lime, limegreen, linen, maroon, mediumaquamarine, mediumblue, mediumorchid, mediumpurple, mediumseagreen, mediumslateblue, mediumspringgreen, mediumturquoise, mediumvioletred, midnightblue, mintcream, mistyrose, moccasin, navajowhite, navy, oldlace, olive, olivedrab, orange, orangered, orchid, palegoldenrod, palegreen, paleturquoise, palevioletred, papayawhip, peachpuff, peru, pink, plum, powderblue, purple, red, rosybrown, royalblue, saddlebrown, salmon, sandybrown, seagreen, seashell, sienna, silver, skyblue, slateblue, slategrey, snow, springgreen, steelblue, tan, teal, thistle, tomato, turquoise, violet, wheat, white, whitesmoke, yellow, yellowgreen
All named colors are fully opaque by default.
Default Color is opaque white
@author K.R. Subramanian, @date 7/8/19
bridges.base.Color.Color | ( | ) |
Construct a default color object (steel blue)
bridges.base.Color.Color | ( | int | r, |
int | g, | ||
int | b, | ||
float | a | ||
) |
Constructor, given r, g, b, a components
r | red component |
g | green component |
b | blue component |
a | alpha component |
bridges.base.Color.Color | ( | int | r, |
int | g, | ||
int | b | ||
) |
Constructor, given r, g, b components
alpha (opacity) defaults to 255
r | red component |
g | green component |
b | blue component |
bridges.base.Color.Color | ( | String | color | ) |
Constructor, given color name
color | one of the CSS colors (check above for full list of colors) |
|
staticpackage |
|
static |
boolean bridges.base.Color.equals | ( | Object | obj | ) |
float bridges.base.Color.getAlpha | ( | ) |
Gets the alpha component
int bridges.base.Color.getBlue | ( | ) |
gets the blue component
byte [] bridges.base.Color.getByteRepresentation | ( | ) |
gets a Byte array representation of a Color
int bridges.base.Color.getGreen | ( | ) |
gets the green component
String bridges.base.Color.getHexRepresentation | ( | ) |
Gets the RGB Color representation as a Hex String
int bridges.base.Color.getRed | ( | ) |
gets the red component
String bridges.base.Color.getRepresentation | ( | ) |
Gets the Color representation as a String
void bridges.base.Color.setAlpha | ( | float | a | ) |
sets the alpha(opacity) component
a | alpha component (0-1.0) |
void bridges.base.Color.setBlue | ( | int | b | ) |
sets the blue component
b | blue component |
void bridges.base.Color.setColor | ( | int | r, |
int | g, | ||
int | b, | ||
float | a | ||
) |
sets color to the given r, g, b, a components
r | red component |
g | green component |
b | blue component |
a | alpha component |
void bridges.base.Color.setColor | ( | String | col_name | ) |
sets the color to the RGBA components given the color name
col_name | color name |
void bridges.base.Color.setGreen | ( | int | g | ) |
sets the green component
g | green component |
void bridges.base.Color.setRed | ( | int | r | ) |
sets the red component
r | red component |
String bridges.base.Color.toString | ( | ) |
|
package |
|
package |