com.opera.core.systems.model
Class OperaColor
java.lang.Object
java.awt.Color
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
| 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 |
| 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 |
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
OperaColor
public OperaColor(int r,
int g,
int b)
OperaColor
public OperaColor(String rgb)
- Parameters:
rgb - string of the format "rgb(120, 120, 120)"
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 - redg - greenb - blue
- Returns:
- a browser-friendly HEX value
Copyright © 2012. All Rights Reserved.