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.23 date: 2021/03/12 17:54:14
user: cg
file: ColorValue.st directory: libview2
module: stx stc-classLibrary: libview2

Description:


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

copyright

COPYRIGHT (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.

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.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 27 Jul 2024 00:40:15 GMT