Thread Tools Display Modes
Prev Previous Post   Next Post Next
02-26-19, 09:09 PM   #1
Terenna
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 105
Color space differences between StatusBar and Texture

Hello,

I've looked fairly thoroughly, but admittedly, may have missed some key words. I've noticed that the "color space" for status bars and textures are different. That is, if one were to:

Lua Code:
  1. local f = CreateFrame('Statusbar', nil, UIParent)
  2. f:SetSize(100, 20)
  3. f:SetPoint('CENTER')
  4. f:SetTexture(some generic texture with no coloring or tinting)
  5. f:SetStatusBarColor(1, 0, 0)
  6.  
  7. local g = CreateFrame('StatusBar', nil, UIParent)
  8. g:SetSize(100, 20)
  9. g:SetPoint('CENTER', 0, - 30)
  10.  
  11. local g.texture = g:CreateTexture(nil, 'BORDER')
  12. g.texture:SetAllPoints()
  13. g.texture:SetTexture(some generic texture with no color or tinting)
  14. g.texture:SetColorTexture(1, 0, 0)
  15. g:SetStatusBarColor(g.texture)
  16.  
  17. local h = CreateFrame('Frame', nil, UIParent)
  18. h:SetSize(100, 20)
  19. h:SetPoint('CENTER', 0, -60)
  20. h.texture = h:CreateTexture(nil, 'BORDER')
  21. h.texture:SetAllPoints()
  22. h.texture:SetColorTexture(1, 0, 0)

you get three bars, and 2 colors. Directly setting StatusBarColor with 0-1 r, g, b values results in almost like a cmyk compared to rgb color space. Making a texture and setting the StatusBarColor with the texture created gets around this, as too does just using a texture and skipping StatusBars all together.

I'm not sure if this is intended what, but it's kind of a pain in the ass with oUF, as all of the bars can only utilize statusbars and require overrides to change colors properly with the statusbarcolor set to a texture and change the texture color using SetColorTexture. Has anyone else encountered this?

Last edited by Terenna : 02-26-19 at 09:55 PM.
  Reply With Quote
 

WoWInterface » Developer Discussions » General Authoring Discussion » Color space differences between StatusBar and Texture


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off