HTML Colors

Alain Farmer alain_farmer at yahoo.com
Tue Jun 29 19:34:51 EDT 2004


Hello,

>> Anyone have the secret for
>> converting rgb to webcolors?

It must be in the air ... i have just tackled this
problem myself in the context of creating a WYSIWYG
DHTML editor with MetaCard. :)

Jeanne's solution, below, is the BEST one. It is how
it SHOULD be done. It's what baseConvert was designed
for. Btw, are y'all thinking, like me, that this RGB
to HEX conversion should have been a bundled feature?

> Web colors are just 3 base-16 numbers, one for each
> item of the RGB numeric color:
>   put "#" into theWebColor -- leading "#"
>   repeat for each item myItem in theColorNumber
>      get baseConvert(myItem,10,16)
>      if the length of it is 1 then put "0" before it
>      put it after theWebColor
>    end repeat

Salutations,

Alain


		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 


More information about the metacard mailing list