Returning multiple values, what?
GetColorAsRGB()
Returns: number red, number green, number blue Can someone explain how to read this, I have never encountered a function that returns 3 separate values. Printing out what it returns gives me 1 all the time, how do I read the individual ones? Edit, think I figured it out: local r, g, b = GetColorAsRGB(); But r g and b are all returning 1, so not sure if I did this correctly. |
I assume that this function requires some arguments to work, surely it can not pull the RGBcode out of thin air? ;)
|
Quote:
local r, g, b = GetColorAsRGB(myColorVariable); |
Quote:
Are you certain that it doesn't return 4 values? When we set colors in controls (ie a label control), we send SetColor(number r, number g, number b, number a), with the first three as discussed and a is the alpha-value. EDIT: I see which function you are using, and there are only three parameters. But what I said about values is correct. |
Lua Code:
|
Sorry I didn't reply, this is the proper usage:
Lua Code:
Now after clicking, one can retrieve the color with Lua Code:
Which are floats ranging from 0.0 also to 1.0 (0-255/0x00-0xFF) I have not yet gotten the WheelThumb to work, but it is not needed. Clicking plainly on the wheel sets internal variables to the corresponding color one has clicked on. |
All times are GMT -6. The time now is 08:33 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI