'From Squeakland-OLPC of 11 February 2008 [latest update: #0] on 19 February 2008 at 12:18:47 pm'! "Change Set: htmlColor-bf Date: 19 February 2008 Author: Bert Freudenberg Bug: (Color fromString: '#222222') asHTMLColor = '#212121' Fix asHTMLColor, also speed up 10x."! !Color methodsFor: 'conversions' stamp: 'bf 2/19/2008 12:10'! asHTMLColor | s | s := '#000000' copy. s at: 2 put: (Character digitValue: ((rgb bitShift: -6 - RedShift) bitAnd: 15)). s at: 3 put: (Character digitValue: ((rgb bitShift: -2 - RedShift) bitAnd: 15)). s at: 4 put: (Character digitValue: ((rgb bitShift: -6 - GreenShift) bitAnd: 15)). s at: 5 put: (Character digitValue: ((rgb bitShift: -2 - GreenShift) bitAnd: 15)). s at: 6 put: (Character digitValue: ((rgb bitShift: -6 - BlueShift) bitAnd: 15)). s at: 7 put: (Character digitValue: ((rgb bitShift: -2 - BlueShift) bitAnd: 15)). ^ s! ! Color class removeSelector: #hex:!