From 1b668821930d1e444a752ca5dbbb69a02252c652 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Sat, 18 Jun 2011 14:09:56 -0500 Subject: [PATCH] add Alpha command to HSV scripts --- Themes/_fallback/Scripts/03 HSV.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Themes/_fallback/Scripts/03 HSV.lua b/Themes/_fallback/Scripts/03 HSV.lua index a4b56baa5d..c2fd988ea7 100644 --- a/Themes/_fallback/Scripts/03 HSV.lua +++ b/Themes/_fallback/Scripts/03 HSV.lua @@ -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; \ No newline at end of file