[BUG]Color>>asColorref (3.2gamma,cs:4811)

Sean Charles scharles at nildram.co.uk
Tue Apr 9 21:36:33 UTC 2002


Whilst writing some other code to convert a Color to an HTML string
(#rrggbb) I think I discovered a bug in the implementation of
Color>>asColorref, here's the code:

asColorref
    "Convert the receiver into a colorref"
    ^ (self red * 255) asInteger + ((self green * 255) asInteger << 8) +
((self green * 255) asInteger << 16)

The last term references the green component again, should this be 'blue' or
have I misunderstood the way in which the components are packed into 'rgb'?

Sean Charles.





More information about the Squeak-dev mailing list