Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reverse RGB
Message
De
06/06/2003 15:41:19
 
 
À
06/06/2003 15:16:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00797412
Message ID:
00797451
Vues:
15
Thanks Steve.

My end goal here is to replace the below:
set color of scheme  1 to W+/BG,N/W,B+/BG,BG/B,B+/BG,GR+/B,GR+/B,N+/N,GR+/BG,N+/BG,+
with colors that will match the windows standard default colors. I know I can change the screen background and forecolor using:
_screen.backcolor=12632256
_screen.forecolor=0
but what about buttons, windows, prompts, etc on older screens (.sprs), etc? How do I set those values without using SET COLOR TO w+/N, etc... Or can you use RGB() with SET COLOR or SET COLOR OF SCHEME?

>Hey again, Trace,
>
>Do you need it parsed?
>
>
>? rgbToColor("212,208,200")
>
>function rgbToColor
>lparameters lcRgb
>        local laColors
>	
>        dimension laColors[3]
>	if aLines(laColors, strtran(lcRGB, ",", chr(13)+chr(10))) <> 3
>		error "Invalid RGB code"
>	else
>		return rgb(val(laColors[1]), val(laColors[2]), val(laColors[3]))
>	endif
>endproc
>
>
>
>>I need to do the reverse of this:
>>
>>? Color2RGB(GetColor())
>>
>>
>>function Color2RGB
>>lparameters RGBcolor
>>* Color = 0x00bbggrr
>>return "rgb("+;
>>	ltrim(str(bitand(RGBColor,0x000000ff)))+","+ ;
>>	ltrim(str(bitrshift(bitand(RGBColor,0x0000ff00),8)))+","+ ;
>>	ltrim(str(bitrshift(bitand(RGBColor,0x00ff0000),16)))+")"
>>
>>
>>If I know the color is 212,208,200 on a form I need to return this color as it as it is stored in _screen.backcolor, etc. I'm braindead this afternoon, anyone willing to share a little function to do this?
>>TIA,TIA,TIA,TIA
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform