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: FourthWorld, heatherlaine, Klaus, kevinmiller

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4000
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: 4000
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: 615
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
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search


Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”