Ray Proudfoot Posted January 23, 2017 Report Posted January 23, 2017 Hi Pete, As you know I'm using your lua script running on a WideClient PC to show fps, remaining VAS and Ai Count. I have transferred the file to my laptop and want the text colour to stand out a bit more but I'm struggling in successfully changing the relevant command. It's light green at present as shown in this line... wnd.textcol(w, 0x06c0) This corresponds to decimal 1728 but I cannot see how that number ends up as light green. I have searched the web for help but all I keep finding are RGB values that will give a certain colour. For example, blue is 0,0,255 Can you help please?
Pete Dowson Posted January 23, 2017 Report Posted January 23, 2017 19 minutes ago, Ray Proudfoot said: It's light green at present as shown in this line... wnd.textcol(w, 0x06c0) This corresponds to decimal 1728 but I cannot see how that number ends up as light green. I have searched the web for help but all I keep finding are RGB values that will give a certain colour. For example, blue is 0,0,255 It is RGB, but the colour is encoded as 12 bits per pixel, not 24, so only 4 bits each, not 8 which your 255 would need. So 6C0 = 6 of Red, 12 of Green, no Blue. Pete
Ray Proudfoot Posted January 23, 2017 Author Report Posted January 23, 2017 Hi Pete, Thanks for your answer. So it's not necessary to convert to decimal. Do you have a link to a calculator that would give the correct value for each colour? I'm really struggling to find anything. LATER: I should be able to adapt the values from RGB calculators. So if yellow is 255,255,0 would that presumably convert to 0CC0.?
Pete Dowson Posted January 23, 2017 Report Posted January 23, 2017 36 minutes ago, Ray Proudfoot said: LATER: I should be able to adapt the values from RGB calculators. So if yellow is 255,255,0 would that presumably convert to 0CC0.? No. C is 12, the max in 4 bits is 15 which is F so bright yellow would be 0x0FF0 . In 24 bits your 255,255,0 would be 0xFFFF00. If you don't understand hexadecimal please review the FAQ subforum thread "About bits, numbers and hexadecimal". Pete
Ray Proudfoot Posted January 23, 2017 Author Report Posted January 23, 2017 Hi Pete, I understand hex and the base is 16. A=10, B=11 and so on. I was mistakenly thinking the max would be 12 and not 16. Got it now, thanks.
Pete Dowson Posted January 23, 2017 Report Posted January 23, 2017 5 minutes ago, Ray Proudfoot said: I was mistakenly thinking the max would be 12 and not 16. 15, not 16. 16 is 0x10, more that 4 bits! ;-) Pete
Ray Proudfoot Posted January 23, 2017 Author Report Posted January 23, 2017 3 minutes ago, Pete Dowson said: 15, not 16. 16 is 0x10, more that 4 bits! ;-) Pete Woops! :)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now