eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'TranslucentColor':

Home

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

Class: TranslucentColor


Inheritance:

   Object
   |
   +--Color
      |
      +--TranslucentColor

Package:
stx:libview
Category:
Graphics-Support
Version:
rev: 1.13 date: 2019/06/28 07:22:42
user: cg
file: TranslucentColor.st directory: libview
module: stx stc-classLibrary: libview

Description:


TranslucentColor represents colors with an alpha (transparency) channel.
This is experimental and not yet used by the system.

[Instance variables:]

  alpha           <Integer>       the internal alpha value (0..255)


Class protocol:

instance creation
o  red: r green: g blue: b alpha: alpha

o  scaledRed: r scaledGreen: g scaledBlue: b alpha: alpha
TranslucentColor scaledRed:0 scaledGreen:0 scaledBlue:0
TranslucentColor scaledRed:0 scaledGreen:0 scaledBlue:0 alpha:1
TranslucentColor scaledRed:0 scaledGreen:0 scaledBlue:0 alpha:0.5
(TranslucentColor scaledRed:0 scaledGreen:0 scaledBlue:0 alpha:0.5) lightened


Instance protocol:

accessing
o  alpha
return the alpha value (0..1),
where 0 is completely transparent and 1 is completely opaque

o  alpha: alphaFraction
set the alpha value (0..1),
where 0 is completely transparent and 1 is completely opaque

o  alphaByte
return the alpha value as byte 0..255,
where 0 is completely transparent and 255 is completely opaque

o  privateAlpha
return the internal alpha value (0..255),
where 0 is completely transparent and 255 is completely opaque

o  scaledAlpha
return the alpha value (0..16rFFFF),
where 0 is completely transparent and 16rFFFF is completely opaque

o  setAlphaByte: aByteValuedInteger
set the alpha value (0..255),
where 0 is completely transparent and 255 is completely opaque

o  setScaledRed: r scaledGreen: g scaledBlue: b
r,g,b must be 0..MAXVALUE

o  setScaledRed: r scaledGreen: g scaledBlue: b alpha: alphaFraction
alphaFraction must be 0..1;
r,g,b must be 0..MAXVALUE

o  setScaledRed: r scaledGreen: g scaledBlue: b alphaByte: a
a must be 0..255;
r,g,b must be 0..MAXVALUE

color operations
o  mixed: amount with: aColor
create a new color from mixing amount of the receiver
with the argument, aColor.
Mixing is done by adding components (i.e. additive mixing)
(which is different from mixing colors on paper, which is subtractive).
With an amount of 1, this is the same as blendWith.

comparing
o  = aColor
(comment from inherited method)
two colors are considered equal, if the color components are;
independent of the device, the color is on

o  almostSameAs: aColor

inspecting
o  inspectorValueStringInListFor: anInspector
returns a string to be shown in the inspector's list

printing & storing
o  storeOn: aStream
append a string representing an expression to reconstruct the receiver
to the argument, aStream

usage example(s):

     (self red:100 green:100 blue:0 alpha:1) storeOn:Transcript

queries
o  isOpaque
return true, if I represent an opaque color

o  isTranslucent
return true, if I represent a translucent color;
that is: not completely opaque

o  isTranslucentColor
return true, if I represent a translucent color;
This means: self isTranslucent, but isTransparent not

o  isTransparent
return true, if I represent a completely transparent color



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Thu, 14 Nov 2019 01:47:46 GMT