Quantcast
WoWInterface - View Single Post - How to get a channel chat color?
View Single Post
05-26-20, 09:01 AM   #4
Ketho
A Molten Giant
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 931
There is GetChannelName()

For Officer that would be this, it should be available after at least PLAYER_ENTERING_WORLD
Lua Code:
  1. local function OnEvent(self, event)
  2.     local info = ChatTypeInfo.OFFICER
  3.     print(info.r, info.g, info.b)
  4. end
  5.  
  6. local f = CreateFrame("Frame")
  7. f:RegisterEvent("PLAYER_ENTERING_WORLD")
  8. f:SetScript("OnEvent", OnEvent)
or from UPDATE_CHAT_COLOR
Lua Code:
  1. local function OnEvent(self, event, name, r, g, b)
  2.     if name == "OFFICER" then
  3.         print(event, name, r, g, b)
  4.     end
  5. end
  6.  
  7. local f = CreateFrame("Frame")
  8. f:RegisterEvent("UPDATE_CHAT_COLOR")
  9. f:SetScript("OnEvent", OnEvent)
  Reply With Quote