tcMenuJavaAPI
Public Member Functions | Static Public Attributes | List of all members
com.thecoderscorner.menu.domain.state.PortableColor Class Reference

Public Member Functions

 PortableColor (int red, int green, int blue)
 
 PortableColor (int red, int green, int blue, int alpha)
 
 PortableColor (String htmlCode)
 
int getRed ()
 
int getGreen ()
 
int getBlue ()
 
int getAlpha ()
 
String toString ()
 
boolean equals (Object o)
 
int hashCode ()
 

Static Public Attributes

static final PortableColor BLACK = new PortableColor(0,0, 0)
 

Detailed Description

A portable color that represents a color in the RGBA space with single byte values for each entry (between 0..255). It can convert to and from web color format strings.

Constructor & Destructor Documentation

◆ PortableColor() [1/3]

com.thecoderscorner.menu.domain.state.PortableColor.PortableColor ( int  red,
int  green,
int  blue 
)

Create a color from RGB with alpha set to full (255), each value from 0 to 255

Parameters
redthe red component
greenthe green component
bluethe blue component

◆ PortableColor() [2/3]

com.thecoderscorner.menu.domain.state.PortableColor.PortableColor ( int  red,
int  green,
int  blue,
int  alpha 
)

Create a color from RGBA using values from 0 to 255

Parameters
redthe red component
greenthe green component
bluethe blue component
alphathe alpha

◆ PortableColor() [3/3]

com.thecoderscorner.menu.domain.state.PortableColor.PortableColor ( String  htmlCode)

Create a color object from a web color code such as #FFFFFF

Parameters
htmlCodethe html code

Member Function Documentation

◆ getAlpha()

int com.thecoderscorner.menu.domain.state.PortableColor.getAlpha ( )
Returns
alpha component between 0 and 255

◆ getBlue()

int com.thecoderscorner.menu.domain.state.PortableColor.getBlue ( )
Returns
blue component between 0 and 255

◆ getGreen()

int com.thecoderscorner.menu.domain.state.PortableColor.getGreen ( )
Returns
green component between 0 and 255

◆ getRed()

int com.thecoderscorner.menu.domain.state.PortableColor.getRed ( )
Returns
red component between 0 and 255

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