Page 1 of 1

Color names for variations of gray color

Posted: Sun Sep 08, 2013 12:34 am
by [-hh]
..........

Re: Color names for variations of gray color

Posted: Sun Sep 08, 2013 11:57 am
by Mark
Hi,

It is correct that many shades of gray are the same, but you are right that gray1 and gray17 should be rather different. The colour names that you find in LiveCode are X11 color names. The names can't be changed, but apparently the colours they refer to in LiveCode are sometimes incorrect.You can read more about X11 colours, particularly shades of gray, on Wikipedia. It should be easy to correct this:

Code: Select all

setProperty x11Gray[theColorProperty] theName
  repeat while the last char of theName is a number
    put the last char of theName before theNum
    delete the last char of theName
  end if
  put theNum*255/100 into myColorItem
  put "set" && theColorProperty && "of the target to" && myColorItem,myColorItem,myColorItem into myScript
  do myScript
end setPropety
Usage:

Code: Select all

set the x11Gray["backColor"] of grc 1 to gray10
Kind regards,

Mark