--- In [email protected], "quantiworks" <quanticwo...@...> wrote: > > --- In [email protected], "brucexs" <bswitzer@> > wrote: > > > > 0x313131 > > > > bruce it still doesn't work. > If > R156 > G74 > B0 > > dll.call("SetSysColors|uint uint* uint*",1,1,0x156740) > > How are RGB values differentiated? I mean 156740 could be > R15 > G67 > B40 > > explaining the different colors I'm getting... > I've tried with hex values and the results are the same. > > dll.call("SetSysColors|uint uint* uint*",1,1,0xbf00) "red" > > changes desktop color to "bright green" > > I'm I doing it wrong? >
I think maybe I should have explained this in more detail. If you want to specify the color as a number, you have to arrange for red to be in the bottom (least significant) 8 bits, green next, then blue. There are 32 bits altogether so the top 8 bits are unused and can be left zero in this context. If you specify the color number directly, the easiest way is to use hexadecimal notation (Base 16 notation), which in PowerPro is signalled by 0x in front of the number. Red 156 is not 156 in hexadecimal; it's 128+16+8+4= (binary) 1001 1100 = 0x9C; Similary 67 = 64+2+1 = 0010 0011 = 0x43 So the rbg you'd want is 0x00679c where I have put the 00 for blue in too just to be explicit. As Sheri says, you can use inputcolor to show the decimal equivalent or win.hex(inputcolor) will show the hex. Windows Calc, scientific view, can also convert. If you have r, g, b, separately in variables, you can compute the rgb single number as rgb = r + (g*256) + (b*256*256) the shift operators shown above do the same calculation -- shift of 8 is same as multiply by 256.
