www.element4solution.com

e4s.html
Class E4Color

java.lang.Object
  extended by e4s.html.E4Color

public class E4Color
extends java.lang.Object

Color definition class. Used as a color reference for various other tags, e.g. the <TD> tag.

Some Color Reference Sites
http://www.illuminated.co.uk
http://www.htmlhelp.com
http://www.inter-corporate.com
http://www.gb.nrao.edu

Since:
JDK 1.4

Field Summary
static E4Color AQUA
          #00FFFF
static E4Color BLACK
          #000000
static E4Color BLUE
          #0000FF
static E4Color BROWN
          #A52A2A
static E4Color CYAN
          #00FFFF
static E4Color D2S_MAIN
          Deprecated.  
static E4Color DARK_BLUE
          #00008B
static E4Color DARK_CYAN
          #008B8B
static E4Color DARK_GRAY
          #A9A9A9
static E4Color DARK_GREEN
          #006400
static E4Color DARK_MAGENTA
          #8B008B
static E4Color DARK_ORANGE
          #FF8C00
static E4Color DARK_RED
          #8B0000
static E4Color DARK_VIOLET
          #9400D3
static E4Color E4S_MAIN
          This is the main color of the D2S logo (some kind of a dark red).
static E4Color FUCHSIA
          #FF00FF
static E4Color GOLD
          #FFD700
static E4Color GRAY
          #808080
static E4Color GREEN
          #008000
static E4Color LIGHT_BLUE
          #ADD8E6
static E4Color LIGHT_GRAY
          #D3D3D3
static E4Color LIGHT_GREEN
          #90EE90
static E4Color LIGHT_GREY
          #D3D3D3
static E4Color LIGHT_PINK
          #FFB6C1
static E4Color LIGHT_YELLOW
          #FFFFE0
static E4Color LIME
          #00FF00
static E4Color MAGENTA
          #FF00FF
static E4Color MAROON
          #800000
static E4Color NAVY
          #000080
static E4Color OLIVE
          #6B8E23
static E4Color ORANGE
          #FFA500
static E4Color ORANGE_RED
          #FF4500
static E4Color PALE_GREEN
          #98FB98
static E4Color PINK
          #FFC8CB
static E4Color PURPLE
          #800080
static E4Color RED
          #FF0000
static E4Color SILVER
          #C0C0C0
static E4Color TEAL
          #008080
static E4Color VIOLET
          #EE82EE
static E4Color WHITE
          #FFFFFF
static E4Color YELLOW
          #FFFF00
 
Constructor Summary
E4Color(E4Color source)
          Create a color object, using another E4Color object.
E4Color(int r, int g, int b)
          Create a color object.
E4Color(java.lang.String source)
          Create a color object, using a string in the format "#123456", where "12" stands for the red value in hexadecimal format, 34 for green and 56 for the blue component.
 
Method Summary
static java.lang.String _getSVNVersionString()
          Get version info string from subversion.
 int getBlue()
          Get the blue component of this color.
 int getGreen()
          Get the green component of this color.
 int getRed()
          Get the red component of this color.
static E4Color GRAY(float percentage)
          Get a gray color, using a shadow mechanism.
static E4Color GRAY(int percentage)
          Create a GRAY color value.
static E4Color newInstance(java.awt.Color color)
          Create a new instance for an E4S color definition based on an AWT definition.
static E4Color Soft(E4Color basecolor, float percentage)
          Create a darker color out of a given base color.
 java.awt.Color toAWT()
          Give the Java AWT's color format.
 java.lang.String toRGB()
          Create the HTML compatible color string, beginning with an '#' character, followed by red, green blue as 2-digits hexadecimal values.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AQUA

public static final E4Color AQUA
#00FFFF


BLACK

public static final E4Color BLACK
#000000


BLUE

public static final E4Color BLUE
#0000FF


FUCHSIA

public static final E4Color FUCHSIA
#FF00FF


GRAY

public static final E4Color GRAY
#808080


GREEN

public static final E4Color GREEN
#008000


PALE_GREEN

public static final E4Color PALE_GREEN
#98FB98


LIME

public static final E4Color LIME
#00FF00


MAROON

public static final E4Color MAROON
#800000


NAVY

public static final E4Color NAVY
#000080


OLIVE

public static final E4Color OLIVE
#6B8E23


PURPLE

public static final E4Color PURPLE
#800080


RED

public static final E4Color RED
#FF0000


SILVER

public static final E4Color SILVER
#C0C0C0


TEAL

public static final E4Color TEAL
#008080


WHITE

public static final E4Color WHITE
#FFFFFF


YELLOW

public static final E4Color YELLOW
#FFFF00


BROWN

public static final E4Color BROWN
#A52A2A


CYAN

public static final E4Color CYAN
#00FFFF


DARK_BLUE

public static final E4Color DARK_BLUE
#00008B


DARK_CYAN

public static final E4Color DARK_CYAN
#008B8B


DARK_GRAY

public static final E4Color DARK_GRAY
#A9A9A9


DARK_GREEN

public static final E4Color DARK_GREEN
#006400


DARK_MAGENTA

public static final E4Color DARK_MAGENTA
#8B008B


DARK_ORANGE

public static final E4Color DARK_ORANGE
#FF8C00


DARK_RED

public static final E4Color DARK_RED
#8B0000


DARK_VIOLET

public static final E4Color DARK_VIOLET
#9400D3


GOLD

public static final E4Color GOLD
#FFD700


LIGHT_BLUE

public static final E4Color LIGHT_BLUE
#ADD8E6


LIGHT_GREEN

public static final E4Color LIGHT_GREEN
#90EE90


LIGHT_GREY

public static final E4Color LIGHT_GREY
#D3D3D3


LIGHT_GRAY

public static final E4Color LIGHT_GRAY
#D3D3D3


LIGHT_PINK

public static final E4Color LIGHT_PINK
#FFB6C1


LIGHT_YELLOW

public static final E4Color LIGHT_YELLOW
#FFFFE0


MAGENTA

public static final E4Color MAGENTA
#FF00FF


ORANGE_RED

public static final E4Color ORANGE_RED
#FF4500


PINK

public static final E4Color PINK
#FFC8CB


VIOLET

public static final E4Color VIOLET
#EE82EE


ORANGE

public static final E4Color ORANGE
#FFA500


E4S_MAIN

public static E4Color E4S_MAIN
This is the main color of the D2S logo (some kind of a dark red).


D2S_MAIN

public static E4Color D2S_MAIN
Deprecated. 
See Also:
E4S_MAIN
Constructor Detail

E4Color

public E4Color(int r,
               int g,
               int b)
Create a color object.

Parameters:
r - value for red (0 <= r <= 255)
g - value for green (0 <= g <= 255)
b - value for blue (0 <= b <= 255)

E4Color

public E4Color(E4Color source)
Create a color object, using another E4Color object.

Parameters:
source - the reference color object

E4Color

public E4Color(java.lang.String source)
Create a color object, using a string in the format "#123456", where "12" stands for the red value in hexadecimal format, 34 for green and 56 for the blue component.

Parameters:
source - the reference color object
Method Detail

toRGB

public java.lang.String toRGB()
Create the HTML compatible color string, beginning with an '#' character, followed by red, green blue as 2-digits hexadecimal values.

Returns:
the HTML compatible color code.

GRAY

public static E4Color GRAY(int percentage)
Create a GRAY color value.

Parameters:
percentage - must be a value between 0 and 100
Returns:
a RGB definition, where red/green/blue equal 255 * (100 - percentage) / 100
See Also:
GRAY(float)

GRAY

public static E4Color GRAY(float percentage)
Get a gray color, using a shadow mechanism.

Parameters:
percentage - 0.0 <= percentage <= 1.0, a percentage of 0 means black, a percentage of 1.0 (= 100%) means white.
Returns:
the new created E4Color object
See Also:
GRAY(int)

Soft

public static E4Color Soft(E4Color basecolor,
                           float percentage)
Create a darker color out of a given base color.

Parameters:
basecolor - the base color definition
percentage - must be a value between 0.0f (black) and 1.0f (the same color).
Returns:
a RGB definition, where red/green/blue is multiplied by percentage.

getRed

public int getRed()
Get the red component of this color.

Returns:
a value between 0 and 255.
See Also:
getBlue(), getGreen()

getGreen

public int getGreen()
Get the green component of this color.

Returns:
a value between 0 and 255.
See Also:
getBlue(), getGreen()

getBlue

public int getBlue()
Get the blue component of this color.

Returns:
a value between 0 and 255.
See Also:
getRed(), getGreen()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toAWT

public java.awt.Color toAWT()
Give the Java AWT's color format.

Returns:
the AWT representation of that color.

newInstance

public static E4Color newInstance(java.awt.Color color)
Create a new instance for an E4S color definition based on an AWT definition.

Parameters:
color - the AWT definition, can be null
Returns:
null if color was null or the E4S representation

_getSVNVersionString

public static java.lang.String _getSVNVersionString()
Get version info string from subversion.

Returns:
the version info string.
See Also:
E4Util.getRevisionCodeFromSVN(Class)

www.element4solution.com