Squeak Class Documentation category index | class index  
 
TranslucentColor
  category: Graphics-Primitives
  superclass: Color
  subclasses:

A TranslucentColor behaves just like a normal color, except that it will pack its alpha value into the high byte of a 32-bit pixelValue. This allows creating forms with translucency for use with the alpha blend function of BitBlt. An alpha of zero is transparent, and 1.0 is opaque.

instance methods
  accessing
  alpha

  conversions
  alpha:
asNontranslucentColor
balancedPatternForDepth:
bitPatternForDepth:
pixelValueForDepth:
pixelWordForDepth:
scaledPixelValue32

  equality
  hash

  object fileIn
  convertToCurrentVersion:refStream:

  printing
  storeArrayValuesOn:
storeOn:

  private
  privateAlpha
setRgb:alpha:

  queries
  isOpaque
isTranslucent
isTranslucentColor
isTransparent

class methods
  no messages
 

instance methods
  accessing top  
 

alpha

Return my alpha value, a number between 0.0 and 1.0 where 0.0 is completely transparent and 1.0 is completely opaque.


  conversions top  
 

alpha:

Answer a new Color with the given amount of opacity ('alpha').


 

asNontranslucentColor


 

balancedPatternForDepth:

Return an appropriate bit pattern or stipple. This will almost never be meaningful for tranlucentColors, except for the degenerate case of tranparency.


 

bitPatternForDepth:

Return an appropriate bit pattern or stipple. This will almost never be meaningful for tranlucentColors, except for the degenerate case of tranparency.


 

pixelValueForDepth:

Return the pixel value for this color at the given depth. Translucency only works in RGB; this color will appear either opaque or transparent at all other depths.


 

pixelWordForDepth:

Return the pixel value for this color at the given depth. Translucency only works in RGB; this color will appear either opaque or transparent at all other depths.


 

scaledPixelValue32

Return the alpha scaled pixel value for depth 32


  equality top  
 

hash

Answer a SmallInteger whose value is related to the receiver's identity.
May be overridden, and should be overridden in any classes that define =


  object fileIn top  
 

convertToCurrentVersion:refStream:

1/13/1999 -- old versions did not have alpha??


  printing top  
 

storeArrayValuesOn:


 

storeOn:

Append to the argument aStream a sequence of characters that is an
expression whose evaluation creates an object similar to the receiver.


  private top  
 

privateAlpha

Return my raw alpha value, an integer in the range 0..255. Used for fast equality testing.


 

setRgb:alpha:

Set the state of this translucent color. Alpha is represented internally by an integer in the range 0..255.


  queries top  
 

isOpaque


 

isTranslucent


 

isTranslucentColor

This means: self isTranslucent, but isTransparent not


 

isTransparent


class methods
  no messages top