Skip to content

Commit e5e90ce

Browse files
author
Sparky
authored
Merge pull request #2028 from thegrb93/hsv2rgb
Stop hsvToColor freeze
2 parents 7ff5b24 + a583740 commit e5e90ce

File tree

1 file changed

+2
-2
lines changed
  • lua/entities/gmod_wire_expression2/core

1 file changed

+2
-2
lines changed

lua/entities/gmod_wire_expression2/core/color.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,12 @@ end
107107

108108
--- Converts <hsv> from the [http://en.wikipedia.org/wiki/HSV_color_space HSV color space] to the [http://en.wikipedia.org/wiki/RGB_color_space RGB color space]
109109
e2function vector hsv2rgb(vector hsv)
110-
local col = HSVToColor(hsv[1], hsv[2], hsv[3])
110+
local col = HSVToColor(math.Clamp(hsv[1] % 360, 0, 360), hsv[2], hsv[3])
111111
return { col.r, col.g, col.b }
112112
end
113113

114114
e2function vector hsv2rgb(h, s, v)
115-
local col = HSVToColor(h, s, v)
115+
local col = HSVToColor(math.Clamp(h % 360, 0, 360), s, v)
116116
return { col.r, col.g, col.b }
117117
end
118118

0 commit comments

Comments
 (0)