• Rainbow text on hud
    6 replies, posted
How can i make rainbow text on hud. I tried using math.random and it was just too fast and not smooth Is there anyway to make it change the color smooth and slow
HSVToColor
Can you post a line of code how to do it?
you should read the tutorial
There are 3 examples of how to use it on the wiki page. Example 1 is similar to what you want to accomplish.
You'll want to use HSVToColor where the hue argument is something like CurTime or another smoothly changing variable.
function RainbowThings(c) --used for flashing colors (like rainbow) (function outside HUDPaint hook) return (math.cos(CurTime()*c)+1)/2 end --And do something like this surface.SetDrawColor(RainbowThings(1) * 255, 255, 255, 255) --You can make it faster RainbowThings(2 or 3 or 4) --Or you can use this function function RainbowThingssecond(c) --used for flashing colors too     return (math.abs(math.sin(CurTime()*c))) end surface.SetDrawColor(RainbowThingssecond(1) * 255, 255, 255, 255) --You can make it faster RainbowThingssecond(2 or 3 or 4) Hope this clears things up!
Sorry, you need to Log In to post a reply to this thread.