|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--canvas.BaseColor
|
+--canvas.WebSafeColor
This class will hold and return colors that are web-safe. This is a web page that displays all of the 216 web-safe colors. Note that the hex values for the individual components are 00,33,66,99,CC,FF in hexidecimal, and multiples of 51 in base 10. There are 6 gradients of brightness for each pure color, and thus 216 (6^3) total colors. These colors can be flawlessly displayed on a system running in 8-bit mode.
| Field Summary |
| Fields inherited from class canvas.BaseColor |
color |
| Constructor Summary | |
WebSafeColor(canvas.AnyColor ac)
Extracts the color from the AnyColor object and rounds to the neatest web-safe color. |
|
WebSafeColor(Color c)
Takes the color and rounds to the nearest web-safe color. |
|
WebSafeColor(int n)
This takes a value from 0 to 215 for the number of the web-safe color. |
|
WebSafeColor(int r,
int g,
int b)
Takes the 3 red, green, blue integers (0-255) and rounds to the nearest web-safe values. |
|
| Method Summary | |
Color |
brighter()
Returns a brighter version of the held color. |
Color |
darker()
Returns a darker version ofthe held color. |
Color |
desaturate()
This method will return a less saturated color than the one held. |
Color |
hueshift(int degrees)
This will return a color with a different hue than the one held. |
Color |
saturate()
This method will return a more saturated color than the one held. |
static void |
SelfTest()
This method demonstrates the supported methods. |
| Methods inherited from class canvas.BaseColor |
getColor, in_range, in_range, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public WebSafeColor(int r,
int g,
int b)
public WebSafeColor(int n)
public WebSafeColor(Color c)
public WebSafeColor(canvas.AnyColor ac)
| Method Detail |
public Color brighter()
brighter in class BaseColorpublic Color darker()
darker in class BaseColorpublic Color saturate()
saturate in class BaseColorpublic Color desaturate()
desaturate in class BaseColorpublic Color hueshift(int degrees)
hueshift in class BaseColordegrees - The number of degrees out of 360
to shift the color.public static void SelfTest()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||