eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'ColorValue':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: ColorValue


Inheritance:

   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

Description:


ColorValue is provided for ST-80 compatibility.
read the section on compatibility issues in the Color class's documentation.


Class protocol:

instance creation
o  brightness: grey
return a grey color.
The grey value is given in 0..1 instead of percent

usage example(s):

     ColorValue brightness:0.5

o  doesNotUnderstand: aMessage
catch other instance creation messages

o  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 

o  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 

o  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


Instance protocol:

accessing
o  blue
return the blue component in 0..1

o  green
return the green component in 0..1

o  light
return the hue component in 0..1

usage example(s):

     Color yellow light
     ColorValue yellow light

o  red
return the red component in 0..1

o  saturation
return the saturation component in 0..1

usage example(s):

     Color yellow saturation     
     ColorValue yellow saturation  

converting
o  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)

o  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 



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Thu, 28 Mar 2024 15:50:21 GMT