Color reference and convert

Chipp Walters chipp at chipp.com
Tue Jul 9 03:23:07 EDT 2002


Sorry for the double post, but I thought this would be interesting for all
RR users.

> > Hi
> >
> > The convert command should be extended to include color references. For
> > example:
> >
> > put the accentColor into tColor
> > convert tColor to RGB
> >
> > This would be much better than having to maintain a list of
> color name to
> > RGB's. I notice that even Jeanne (Color Reference stack) had to
> develop a
> > needless workaround because there is no built in convert function for
> color
> > references.

I use the following: (a mouseMove handler in the stack script)

on mouseMove
  put the mouseColor into thecolor
  set the numberFormat to "##"
  put formathex(baseConvert(item 1 of thecolor,10,16)) into R
  put formathex(baseConvert(item 2 of thecolor,10,16)) into G
  put formathex(baseConvert(item 3 of thecolor,10,16)) into B
  put thecolor into cd fld 1
end mouseMove

function formathex thevalue
  if the length of thevalue is 1
  then put "0" before thevalue
  return thevalue
end formathex




More information about the use-livecode mailing list