Skip to content

Commit

Permalink
Merge pull request #2028 from thegrb93/hsv2rgb
Browse files Browse the repository at this point in the history
Stop hsvToColor freeze
  • Loading branch information
Sparky authored Feb 19, 2020
2 parents 7ff5b24 + a583740 commit e5e90ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/entities/gmod_wire_expression2/core/color.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ end

--- 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]
e2function vector hsv2rgb(vector hsv)
local col = HSVToColor(hsv[1], hsv[2], hsv[3])
local col = HSVToColor(math.Clamp(hsv[1] % 360, 0, 360), hsv[2], hsv[3])
return { col.r, col.g, col.b }
end

e2function vector hsv2rgb(h, s, v)
local col = HSVToColor(h, s, v)
local col = HSVToColor(math.Clamp(h % 360, 0, 360), s, v)
return { col.r, col.g, col.b }
end

Expand Down

0 comments on commit e5e90ce

Please sign in to comment.