Squeak Color>>asHTMLColor
2004.06.04 Here's a method you can use to convert a Color object to an HTML color. I like to set up a rectangle morph, then embed a watcher with the morph's color asHTMLColor in it. Then you can change the morph color and use the HTML color in your CSS. For extra points change your watcher to print in white on a dark rectangle and black on a light rectangle. Hint: base your decision on "color luminance". Thanks to M. Denker for repackaging this and adding the test cases.
Download asHTMLColor.03.cs, posted (and revised) on Squeak-dev June 2004.