Okay, I think I've got it.

I was playing with the '0x' input, and noticed that I would not get
consistant results unless I used at least eight characters. In all
cases without exception, I would only get a targeted 'pure' colour if
there were 8 characters (I think that anything short of eight digits
results in 'missing' digits prepended as '0's to the beginning of the
8-char hex string). After a bit of playing around, I finally managed
to get a few combinatons that resulted in the '#FF0000' pure red I was
looking for, and also did the decimal conversions:

0xFFFFFF00 = 4042321920
0xF0FF0000 = 4043243520
0xF0F0F000 = 4294967040
0xFFF00000 = 4293918720

...I then entered the decimal value in the styledMap 'hue' option, and
got a pure red in all cases.

I was at first persuaded that the last two characters had to be '00',
but I am certain that, to get a pure red, the hex can be any
hexidecimal combination that computes to a decimal number that results
in a pure red.

Now all I have to do is convert a 6-character RGB hexidecimal color
code to an 8-character hexidecimal string.

Still wondering about that '9-character switch' that makes Google
override its default colours - but that can wait for later.

On Aug 26, 1:48 pm, Sefu <[email protected]> wrote:
> If you want to play with hues precisely, go to the maps API style
> wizard and select an element, select a 'pure' hue, (say, FF0000) in
> the hue bar using a colormetre to click the right colour (mac's OS-
> native 'DigitalColor Meter' is cool for this - set it to a 1px
> aperture), set the saturation bar to 100 (this makes damn sure that,
> no matter what the map's original setting was, the result will always
> be 100 (it can't be more). Then, testing with the colour metre, play
> with the gamma bar until the colour of the element you are modifying
> is the same as the pure hue you chose. This seems to create testing
> conditions that are constant across the board.
>
> hex '0xff0000' = dec '16711680' ... doh! Gives the same results when
> submitted as a hue.
>
> #225 = #000225 : yep, always the case - 'missing' hex characters (out
> of the mandatory six) are automatically appended after the '#' (#FF ==
> #0000FF) - but you know this ; )
>
> 0x225 = 0x000225 gives the same results as well, for the record.
>
> But why the different results between '#255' and '0x255'? They behave
> in the same way... I think Google is expecting something different. I
> tried prepending 'FF' (the oft-appearing Google 'gamma factor'
> mentioned elsewhere in this thread), but no go... is google perhaps
> expecting a 16-bit hex number?
>
> On Aug 26, 10:12 am, "William ." <[email protected]> wrote:
>
>
>
> > On Wed, Aug 25, 2010 at 6:59 PM, Sefu <[email protected]> wrote:
> > > ... yet '225' renders magenta, '#225' renders blue, and '0x225'
> > > renders purple
>
> > Obviously these are undocumented properties and cannot be relied upon in a
> > production system, but I believe that:
> > 1. '225' and '0x225' are relative hues, specified in decimal degrees,
> > applied as an adjustment to the existing color in ROADMAP, and
> > 2. '#225' is an absolute rgb hue, which replaces the existing color in
> > ROADMAP
>
> > RELATIVE HUES
>
> > 225 is decimal already, and
> > 0x225 hex = 549 decimal, which is 360 + 189
>
> > so on an example with roads where the shaded color is yellow, 60 degrees,
> > then the expected hues are calculated by adding the shift to 60:
>
> > (a) 225 + 60 = 285
> > (b) 189 + 60 = 249
>
> > when I tried it (with saturation 100) and then selected the resulting colors
> > with photoshop it said 284 and 248 respectively, very close to the predicted
> > hue.
>
> > ABSOLUTE HUES
>
> > I think '#225' is interpreted with leading zeros to pad to 6 hex digits =
> > '#000225'
> > photoshop says this is a hue of 237 degrees.  This is confirmed when trying
> > hue: '#225' on roads (with saturation: 100)
>
> > ...

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to