Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Rebol Color to HTML Color

From: sunandadh::aol::com at: 27-Jun-2002 4:40

I recently "needed" (as in wanted on a whim) a varying range of pastel colors for a HTML table. The code I came up with to convert a rebol tuple (eg 255.0.255) into a HTML color spec (#FF00FF) is ungainly to say the least. Any ideas for a better way? Thanks, Sunanda. ;; ================== get-random-pastel: func [/local t1 t2] [ ;; ================== t1: 255.255.255 - random/secure 15.15.15 t2: mold to-binary join to-char t1/1 [to-char t1/2 to-char t1/3] replace t2 "{" "" replace t2 "}" "" return t2 ]