Setting Colors
I've just started looking into writing addons and came across an issue that perplexed me and I am hoping one of you can shed some light into the issue.
I simply want to set the color of a status bar to a mint green shade rgb: 200,255,210 or hex: #c8ffd2 In the XML I Have: Code:
Code:
in the LUA I want to change the status bar color depending on events. when I try to set the color back to the mint green, it shows as all white Code:
Nyght_Status_Window_StatusBar:SetColor(200, 255, 210, 1.0) Code:
Nyght_Status_Window_StatusBar:SetColor(255, 0, 0, 1.0) I even set it to yellow with no problem Code:
Nyght_Status_Window_StatusBar:SetColor(255, 255, 0, 1.0) Code:
Nyght_Status_Window_StatusBar:SetColor(255, 255, 1, 1.0) I did notice, that if I used a lower alpha value in the XML Code:
(IE. Code:
Nyght_Status_Window_StatusBar:SetColor(255, 255, 0, 1.0) Is there something similar I am missing with the color, or why the blue color isn't working as I would expect? Thanks for any insight to this issue. Nyght |
It's percentages in the lua. Do X/255 if you want to write it out in an easy to read rgb fashion.
|
I'm not sure how to address your question specifically but just keep in mind that some routines like that don't want numbers they want a table and it has to be keyed and then you unpack it. The keys are r=255, g= 255,b=255a=255. There are no decimals that I am aware of for the alpha but I haven't looked at the source in a while.
|
ESO "RGB" is between 0 and 1, not 0 and 255:
Code:
-- Convert FFFFFF to 1, 1, 1 |
For Lua code you should just rely on the ZO_ColorDef class which handles all the tedious stuff:
Lua Code:
|
thanks everyone - I knew it had to be something simple
|
All times are GMT -6. The time now is 10:44 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI