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
[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1553
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

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5118
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Color names for variations of gray color

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

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/livecodebook

Post Reply

Return to “IDE Contributors”