LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Get a color name from any RGB combination?

I stumbled across this nice one:
http://gauth.fr/2011/09/get-a-color-...b-combination/

Very neat indeed :-)


Yes.., quite impressive to say the least!
But made in JavaScript, which I know virtual nothing about...

I was wondering, if anyone has made something similar in VBA?


Don't know, but maybe Karl Peterson has something you can modify to do
similar.

Can it be done?
How?


Simplest approach:
Parse the file "dataset.js" into columns and use a lookup function to
return a name based on user input. (I'd probably have it work both
ways, meaning user can optionally enter a name and return the RGB
value!)

I see that this file is one continuous string and so may need to be
edited so you can use Split() for each color name value. As is.., you
can parse each piece of color data using "}," as a delimiter to load
your initial array.

After that each element is a comma delimited set of property:value
pairs where you can Split() each part into a temp array, then split
again into a 2nd temp array using ":" as the delimiter. (you only need
to extract the UBound value of this 2nd array)

Once you get there you can decide how to put the table into a
worksheet. I'd probably build an output 2D array in memory, then 'dump'
that into the worksheet (OR a delimited file where I can search for my
RGB values, OR just store the data so it's easily retrievable into a
workable array at runtime)!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
custom color for font color and or background shading color Ben[_14_] Excel Programming 2 May 5th 10 02:32 PM
combination combination? Excel Discussion (Misc queries) 10 January 13th 07 04:08 AM
Combination UsGrant_75 Charts and Charting in Excel 1 October 27th 06 08:04 PM
combination [email protected][_2_] Excel Programming 2 June 23rd 06 09:28 AM
combination deco Excel Programming 1 October 18th 05 06:40 PM


All times are GMT +1. The time now is 08:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"