View Single Post
04/01/14, 06:07 AM   #4
skyraker
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 154
Originally Posted by Tingle0x539 View Post
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.
The color code in game is given as an RGB value from 0 to 1, and correlates to a percentage-type of value for each color.

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.
  Reply With Quote