|
Class: ColorValue
Object
|
+--Color
|
+--ColorValue
- Package:
- stx:libview2
- Category:
- Graphics-Support
- Version:
- rev:
1.21
date: 2018/01/11 17:17:45
- user: stefan
- file: ColorValue.st directory: libview2
- module: stx stc-classLibrary: libview2
- Author:
- Claus Gittinger
ColorValue is provided for ST-80 compatibility.
read the section on compatibility issues in the Color class's documentation.
instance creation
-
brightness: grey
-
return a grey color.
The grey value is given in 0..1 instead of percent
usage example(s):
ColorValue brightness:0.5
|
-
doesNotUnderstand: aMessage
-
catch other instance creation messages
-
hue: hue saturation: sat brightness: light
-
return a color.
The hue, saturation and brightness values are given in 0..1 instead of
degrees / percent
usage example(s):
ColorValue hue:0 saturation:1 brightness:0.5
|
-
red: r green: g blue: b
-
return a color from red, green and blue values.
The arguments, r, g and b must be in the range (0..1)
usage example(s):
ColorValue red:0 green:1 blue:0
ColorValue red:0 green:0.5 blue:0
|
-
scaledRed: r scaledGreen: g scaledBlue: b
-
return a color from scaled red, green and blue values.
This rescales from ST80 scale-values (0..1FFF) to whatever our
internal scale value is.
usage example(s):
ColorValue scaledRed:0 scaledGreen:16r0FFF scaledBlue:0
|
accessing
-
blue
-
return the blue component in 0..1
-
green
-
return the green component in 0..1
-
light
-
return the hue component in 0..1
usage example(s):
Color yellow light
ColorValue yellow light
|
-
red
-
return the red component in 0..1
-
saturation
-
return the saturation component in 0..1
usage example(s):
Color yellow saturation
ColorValue yellow saturation
|
converting
-
fromLiteralArrayEncoding: encoding
-
read my values from an encoding.
The encoding is supposed to be of the form:
#(ColorValue scaledRed scaledGreen scaledBlue)
This is the reverse operation to #literalArrayEncoding.
usage example(s):
ColorValue new fromLiteralArrayEncoding:#(#Color 7700 7700 7700)
ColorValue new fromLiteralArrayEncoding:#(ColorValue red)
|
-
literalArrayEncoding
-
encode myself as an array, from which a copy of the receiver
can be reconstructed with #decodeAsLiteralArray.
The encoding is:
(#ColorValue scaledRed scaledGreen scaledBlue)
usage example(s):
ColorValue new fromLiteralArrayEncoding:#(#Color 50 25 25)
(ColorValue red:0.5 green:0.25 blue:1.0) literalArrayEncoding
|
|