Package com.google.gwt.canvas.dom.client
Class CssColor
- java.lang.Object
-
- com.google.gwt.core.client.JavaScriptObject
-
- com.google.gwt.canvas.dom.client.FillStrokeStyle
-
- com.google.gwt.canvas.dom.client.CssColor
-
public class CssColor extends FillStrokeStyle
CSS Color object.To handle dev mode we must wrap JSO strings in an array. Therefore, when in dev mode, CssColor is actually an array with one element that is the JSO. In Production Mode, this is not needed.
- See Also:
- Cascading Style Sheets, level 1
-
-
Field Summary
-
Fields inherited from class com.google.gwt.canvas.dom.client.FillStrokeStyle
TYPE_CSSCOLOR, TYPE_GRADIENT, TYPE_PATTERN
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CssColor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CssColor
make(int r, int g, int b)
Sets the RGB color value.static CssColor
make(java.lang.String cssColor)
Creates a CssColor object.java.lang.String
value()
Returns the value of the CssColor, as a String.-
Methods inherited from class com.google.gwt.canvas.dom.client.FillStrokeStyle
getType
-
Methods inherited from class com.google.gwt.core.client.JavaScriptObject
cast, createArray, createArray, createFunction, createObject, equals, hashCode, toSource, toString
-
-
-
-
Method Detail
-
make
public static final CssColor make(int r, int g, int b)
Sets the RGB color value.- Parameters:
r
- red, integer between 0 and 255g
- green, integer between 0 and 255b
- blue, integer between 0 and 255- Returns:
- a
CssColor
object
-
make
public static final CssColor make(java.lang.String cssColor)
Creates a CssColor object. Examples: blue, #ff0000, #f00, rgb(255,0,0)- Parameters:
cssColor
- the CSS color- Returns:
- a
CssColor
object
-
value
public final java.lang.String value()
Returns the value of the CssColor, as a String.- Returns:
- the value of the color, as a String.
-
-