what color of transparent color is?

ohshima at is.titech.ac.jp ohshima at is.titech.ac.jp
Thu Nov 18 15:20:07 UTC 1999


  Hi,

  I'm a bit confusing about the treatment of the white pixel
value and transparent pixel value.  When I evaluate the
following code, 

  f _ Form extent: 1 at 1 depth: 16.
  "f pixelValueAt: 0 at 0 put: 0."

  f colorAt: 0 at 0                     "=>  (Color r: 0.0 g: 0.0 b: 0.0)"
  (f asFormOfDepth: 8) colorAt: 0 at 0  "=>  (Color r: 1.0 g: 1.0 b: 1.0)"
  (f as8BitColorForm) colorAt: 0 at 0   "=>  (Color transparent)"

the results of the last three expressions are different from
each other.  This means that when you convert a 16-bit or
32-bit depth Form into 8 or lower one, the "black" pixels
get changed to white.

  Also there is another problem:

  f _ Form extent: 2 at 1 depth: 8.
  f colorAt: 0 at 0 put: (Color r: 0 g: 0 b: 0).
  (f asFormOfDepth: 16) colorAt: 0 at 0   "=> (Color r: 0.0 g: 0.0 b: 0.032)"

  Black is mapped to "darkest blue" here.

  Because we have TranslucentColor, I think we don't have to
use pixel value 0 as the transparent color.  Swapping the
entry 1 and 2 of IndexedColor (and fixing related things)
seems the solution.

  However, it means that we have to modify the definition of
SetupPixMap() in every VM support code.  Is it reasonable?

  I can't propose the workaround code here, but I think we
should fix the problem and move SetupPixMap() to interp.c.
(I think Squeak Central and others already know this
problem, but I want this to be fixed).

  -- Yoshiki





More information about the Squeak-dev mailing list