|
Class: ColorValue
Object
|
+--Color
|
+--ColorValue
- Package:
- stx:libview2
- Category:
- Graphics-Support
- Version:
- rev:
1.23
date: 2021/03/12 17:54:14
- user: cg
- file: ColorValue.st directory: libview2
- module: stx stc-classLibrary: libview2
ColorValue is provided for ST-80 compatibility.
read the section on compatibility issues in the Color class's documentation.
copyrightCOPYRIGHT (c) 1995 by Claus Gittinger
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
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
|
|