Google chart map colors

56 views
Skip to first unread message

seth7f

unread,
Mar 31, 2008, 2:04:25 AM3/31/08
to Google Chart API
I've been trying to write a function co convert the color represented
in simple encoding to hex (or rgb values).

This is so I can create a legend for the map.

Does anyone have any suggestions? I've tried a couple of concepts but
my results have not even been close.

Eg.

// chco=ffffff,edf0d4,13390a

Function simple2hex($gradient_start, $gradient_end, $simple_value)
{
Return $hex_color;
}

$hex_color = simple2hex('ffffff', 'edf0d4', 'A');

Thanks for any help.

Jeffrey Barke

unread,
Apr 3, 2008, 11:12:53 AM4/3/08
to google-c...@googlegroups.com
Seth,

Check out my tmMapLegend PHP 4 class. It interpolates colors to assist in generating a legend for the Google Charts API map chart type. It currently accepts simple or text encoded values and two or three color ramps and it returns a hex color or an array of hex colors.

Jeffrey

--
Cheers.
Jeffrey Barke
jeffre...@theMechanism.com
Lead Developer, US
theMechanism - New York City
440 9th Avenue, 8th Floor
New York, NY 10001-1631

t: +1 212.404.3150
c: +1 917.941.1232
f: +1 212.404.3228

http://www.theMechanism.com

Subscribe to theMechcast, our monthly Podcast:
http://feeds.feedburner.com/theMechcast

theMechanism - London
3rd Floor
405 The Strand
London E14 9FW
United Kingdom

t: +44 (0)20 7240 4964
f: +44 (0)20 7240 2262

--
The information contained in this Electronic mail message is attorney privileged and confidential information intended only for the use of the individual or entity named above. Such information also is intended to be privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by telephone.

Blah, blah, blah...
--


Reply all
Reply to author
Forward
0 new messages