Color names for variations of gray color

This forum is a working group for community contributors to the LiveCode IDE included in the main LiveCode distribution.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Color names for variations of gray color

Post by [-hh] » Sun Sep 08, 2013 12:34 am

Last edited by [-hh] on Wed Aug 13, 2014 12:18 pm, edited 1 time in total.
shiftLock happens

Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5145
Joined: Thu Feb 23, 2006 9:24 pm

Re: Color names for variations of gray color

Post by Mark » Sun Sep 08, 2013 11:57 am


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

Code: Select all

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

The biggest LiveCode group on Facebook:
The book "Programming LiveCode for the Real Beginner"! Get it here!

Post Reply

Return to “IDE Contributors”