Color Name

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3324
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Color Name

Post by bn » Wed Dec 16, 2015 8:46 pm

There are 552 colorNames with unique RGB values. There are 256*256*256 possible RGB values = 16.777.216

If you set the startValue of your sliders to 0 you will find more hits. E.g. 255,0,0 or 255,255,0.

Otherwise your chances are slim to find the exact RGB value of a given color name. Something like one in 30393. (16.777.216 / 552) if my math is correct.


Kind regards
Bernd

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3324
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Color Name

Post by bn » Wed Dec 16, 2015 9:42 pm

on a Mac you can use this to get colorsToNames and namesToColor in the IDE of LC 8 DP 6 and up

Code: Select all

on mouseUp
   put specialFolderPath("engine") into tPath
   set the itemDelimiter to "/"
   put "" into last item of tPath
   put "Tools/Toolset/resources/supporting_files/colors/colorsToNames.txt" after tPath
   put url ("file:" & tPath) into field 1
   put "Tools/Toolset/resources/supporting_files/colors/namesToColors.txt" into item - 6 to - 1 of tPath
   put url ("file:" & tPath) into field 2
end mouseUp
it lists what the title says.

for other operationg systems the path probably has to be adapted.

Kind regards

Bernd

AndyP
Posts: 451
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: Color Name

Post by AndyP » Wed Dec 16, 2015 9:55 pm

Hi Bernd,

Great find. Haven't looked at the supporting text files before. Very Interesting.
Andy Piddock

http://2108.co.uk/tinyide/ - Mini LC IDE alternative

http://2108.co.uk/script-editor-themer/ - Script Editor colour theming

http://livecodeshare.runrev.com/stack/897/LiveCode-Multi-Search - Search across 8 LC resources

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 3819
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Color Name

Post by richmond62 » Sun Mar 13, 2016 12:13 pm


Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”