add Alpha command to HSV scripts

This commit is contained in:
AJ Kelly
2011-06-18 14:09:56 -05:00
parent 5386525448
commit 1b66882193
+12
View File
@@ -246,4 +246,16 @@ function Hue(color,newHue)
end
c.Hue = newHue
return HSVToColor(c)
end;
function Alpha(color,percent)
local c = ColorToHSV(color);
-- error checking
if percent < 0 then
percent = 0.0;
elseif percent > 1 then
percent = 1.0;
end;
c.Alpha = percent;
return HSVToColor(c);
end;