Page 1 of 1
RGB Problem
Posted: Fri Nov 09, 2007 1:49 pm
by <David.C#S4701L>
According to my friend (and
http://www.javascripter.net/faq/hextorgb.htm )
Code: Select all
R = Red($413eba)
G = Green($413eba)
B = Blue($413eba)
MessageRequester("", Str(R)+" "+Str(G)+" "+Str(B))
and
Code: Select all
R = 10
G = 20
B = 30
MessageRequester("", Hex(RGB(R,G,B)))
Is actually returning the combination BGR (Blue, green, red) instead of RGB. (red green blue)
Re: [4.10 Final] RGB bug?
Posted: Fri Nov 09, 2007 2:38 pm
by PB
Posted: Fri Nov 09, 2007 3:56 pm
by Psychophanta
What is the problem here? Come on ! all is correct.
No bug. Don't scare to people :roll:
Posted: Fri Nov 09, 2007 6:05 pm
by ..::Origin::..
Code: Select all
R = Red($413eba)
G = Green($413eba)
B = Blue($413eba)
MessageRequester("", Str(R)+" "+Str(G)+" "+Str(B))
It Is done as BBGGRR, I do not think the functions, Red() : Blue() : Green; were supposed to be used with this.
A quick modification would be to just do:
Code: Select all
R = Blue($413eba)
G = Green($413eba)
B = Red($413eba)
MessageRequester("", Str(R)+" "+Str(G)+" "+Str(B))
As much as It doesn't look right, It works fine.
Posted: Fri Nov 09, 2007 9:33 pm
by Fred
specifying a color numerically is always done with Red as the lower digit.
$FF is full red, right ?
So $0000FF is still full red... And you got the point.
Posted: Sat Nov 10, 2007 12:39 am
by PB
People tend to look at $0000FF like this:
And they think FF relates to BB, which is wrong (as Fred pointed out).
Posted: Fri Nov 16, 2007 4:01 am
by Rescator
Blame intel for this behaviour. All x86 based CPU's store 16bit and 24bit and 64bit values etc. "in reverse".
Search around this forum though, both I and others have done a few small snippets of code and examples on how to invert/flip the RGB numbers.
@Fred, maybe a flip value command could be added to a future PB? In ASM it's like a single operator at least for 32bit values.
Posted: Mon Nov 19, 2007 2:58 pm
by Dreamland Fantasy