Bridges-Java-2.3.3  2.3.3
Bridges(JavaAPI)
Public Member Functions | List of all members
bridges.base.Color Class Reference

This class is used to represent colors in BRIDGES. More...

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 ()
 
void setColor (String col_name)
 

Detailed Description

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.

Author
K.R. Subramanian,
Date
7/14/16

Constructor & Destructor Documentation

bridges.base.Color.Color ( )

Constructors

bridges.base.Color.Color ( int  r,
int  g,
int  b,
float  a 
)

Constructor, given r, g, b, a components

Parameters
r,g,b,a- checked to be in the range 0-255
bridges.base.Color.Color ( int  r,
int  g,
int  b 
)

Constructor, given r, g, b components alpha (opacity) defaults to 255

Parameters
r,g,b,a- checked to be in the range 0-255
bridges.base.Color.Color ( String  color)

Constructor, given color name

Parameters
color- checked to be in the list of possible color names

Member Function Documentation

float bridges.base.Color.getAlpha ( )

gets the alpha component

Returns
alpha - returns the alpha(opacity) component of the color
int bridges.base.Color.getBlue ( )

gets the blue component

Returns
blue - returns the blue component of the color
byte [] bridges.base.Color.getByteRepresentation ( )

gets a Byte array representation of a Color

Returns
- returns the RGBA color as a byte array
int bridges.base.Color.getGreen ( )

gets the green component

Returns
green - returns the green component of the color
String bridges.base.Color.getHexRepresentation ( )

gets the RGB Color representation as a Hex String

Returns
- returns the RGB color as hexadecimal String
int bridges.base.Color.getRed ( )

gets the red component

Returns
red - returns the red component of the color
String bridges.base.Color.getRepresentation ( )

gets the Color representation as a String

Returns
- returns the color as a String with an RGBA array format
void bridges.base.Color.setAlpha ( float  a)

sets the alpha(opacity) component

Parameters
a- checked to be in the range 0-255
void bridges.base.Color.setBlue ( int  b)

sets the blue component

Parameters
b- checked to be in the range 0-255
void bridges.base.Color.setColor ( int  r,
int  g,
int  b,
float  a 
)

sets color to the given r, g, b, a components

Parameters
r,g,b,a- checked to be in the range 0-255
void bridges.base.Color.setColor ( String  col_name)

sets the color to the RGBA components given the color name

Parameters
col_namecolor name
void bridges.base.Color.setGreen ( int  g)

sets the green component

Parameters
g- checked to be in the range 0-255
void bridges.base.Color.setRed ( int  r)

sets the red component

Parameters
r- checked to be in the range 0-255

The documentation for this class was generated from the following file: