Hey all, Happy Christmas!
Just a quick question...
Does anyone know of a simple way to obtain the colour of the most recently shown text in the ChatFrames?
I have a function in my addon which makes a frame 'pulse' when a new message is received, kinda like:
Lua Code:
ChatButton.Pulse = function(self)
self.fadeStep = ( (self.pulseIntensity * 2) / (self.pulseDuration * GetFramerate()) );
self.isFading = nil;
self.pulseTexture:SetTexture(1, 1, 1); -- [color="Red"]to match chatType colour[/color]
return ( self.pulseIsEnabled and (not self.alpha) ) and self:SetScript("OnUpdate", self.OnUpdate);
end
This doesn't really relate to the question I guess, but the onupdate code is:
Lua Code:
ChatButton.OnUpdate = function(self)
self.alpha = self.isFading and ( (self.alpha or 0) - self.fadeStep ) or ( (self.alpha or 0) + self.fadeStep );
if ( (self.alpha >= 0) and (self.alpha <= self.pulseIntensity) ) then
return self.pulseTexture:SetAlpha(self.alpha);
elseif self.isFading then
self.alpha, self.fadeStep, self.isFading = nil, nil, nil;
return self:SetScript("OnUpdate", nil);
end
self.alpha, self.isFading = self.pulseIntensity, true;
end
Thanks in advance for any possible guidance
Aanson