com.opera.core.systems.model
Class OperaColor

java.lang.Object
  extended by java.awt.Color
      extended by com.opera.core.systems.model.OperaColor
All Implemented Interfaces:
Paint, Transparency, Serializable

public class OperaColor
extends Color

The OperaColor class is used to encapsulate colours in the default sRGB colour space. Specifically OperaColor extends Color and adds the functionality of parsing internal Opera RGB strings to the Color object. It also holds colour values. It accepts a string for the format "rgb(120, 120, 120)" as a constructor argument.

Author:
Deniz Turkoglu , Andreas Tolf Tolfsen
See Also:
Serialized Form

Field Summary
protected  Integer highBlue
           
protected  Integer highGreen
           
protected  Integer highRed
           
protected  int id
           
protected  Integer lowBlue
           
protected  Integer lowGreen
           
protected  Integer lowRed
           
 
Fields inherited from class java.awt.Color
black, BLACK, blue, BLUE, cyan, CYAN, DARK_GRAY, darkGray, gray, GRAY, green, GREEN, LIGHT_GRAY, lightGray, magenta, MAGENTA, orange, ORANGE, pink, PINK, red, RED, white, WHITE, yellow, YELLOW
 
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
 
Constructor Summary
OperaColor(int r, int g, int b)
           
OperaColor(String rgb)
           
 
Method Summary
 String getHex()
          Returns the HEX value representing the colour in the default sRGB ColorModel.
 Integer getHighBlue()
           
 Integer getHighGreen()
           
 Integer getHighRed()
           
 int getId()
           
 Integer getLowBlue()
           
 Integer getLowGreen()
           
 Integer getLowRed()
           
 void setHighBlue(Integer highBlue)
           
 void setHighGreen(Integer highGreen)
           
 void setHighRed(Integer highRed)
           
 void setId(int id)
           
 void setLowBlue(Integer lowBlue)
           
 void setLowGreen(Integer lowGreen)
           
 void setLowRed(Integer lowRed)
           
static String toHex(int r, int g, int b)
          Returns a web browser-friendly HEX value representing the colour in the default sRGB ColorModel.
 
Methods inherited from class java.awt.Color
brighter, createContext, darker, decode, equals, getAlpha, getBlue, getColor, getColor, getColor, getColorComponents, getColorComponents, getColorSpace, getComponents, getComponents, getGreen, getHSBColor, getRed, getRGB, getRGBColorComponents, getRGBComponents, getTransparency, hashCode, HSBtoRGB, RGBtoHSB, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

id

protected int id

lowRed

protected Integer lowRed

highRed

protected Integer highRed

lowGreen

protected Integer lowGreen

highGreen

protected Integer highGreen

lowBlue

protected Integer lowBlue

highBlue

protected Integer highBlue
Constructor Detail

OperaColor

public OperaColor(int r,
                  int g,
                  int b)

OperaColor

public OperaColor(String rgb)
Parameters:
rgb - string of the format "rgb(120, 120, 120)"
Method Detail

getId

public int getId()

setId

public void setId(int id)

getLowRed

public Integer getLowRed()

setLowRed

public void setLowRed(Integer lowRed)

getHighRed

public Integer getHighRed()

setHighRed

public void setHighRed(Integer highRed)

getLowGreen

public Integer getLowGreen()

setLowGreen

public void setLowGreen(Integer lowGreen)

getHighGreen

public Integer getHighGreen()

setHighGreen

public void setHighGreen(Integer highGreen)

getLowBlue

public Integer getLowBlue()

setLowBlue

public void setLowBlue(Integer lowBlue)

getHighBlue

public Integer getHighBlue()

setHighBlue

public void setHighBlue(Integer highBlue)

getHex

public String getHex()
Returns the HEX value representing the colour in the default sRGB ColorModel.

Returns:
the HEX value of the colour in the default sRGB ColorModel

toHex

public static String toHex(int r,
                           int g,
                           int b)
Returns a web browser-friendly HEX value representing the colour in the default sRGB ColorModel.

Parameters:
r - red
g - green
b - blue
Returns:
a browser-friendly HEX value


Copyright © 2012. All Rights Reserved.