Skip to content

Commit a92d960

Browse files
committed
Fix rainbow color math
1 parent ec9a70a commit a92d960

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lua/autorun/xp_rainbow_player_color_cycle.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ if SERVER then
9595

9696
local base_value = do_not_cycle and v:Deaths() or time * speed + offset -- This is the base value used for the color cycle. It's time (with speed multiplier and offset).
9797

98-
local r = ( 0.5 * (math.sin(base_value - 1) + 1) ) * lightness
99-
local g = ( 0.5 * (math.sin(base_value) + 1) ) * lightness
100-
local b = ( 0.5 * (math.sin(base_value + 1) + 1) ) * lightness
98+
local r = ( 0.5 * (math.sin(base_value - 2) + 1) ) * lightness
99+
local g = ( 0.5 * (math.sin(base_value + 2) + 1) ) * lightness
100+
local b = ( 0.5 * (math.sin(base_value) + 1) ) * lightness
101101

102102
if player_color_enabled then
103103
v:SetPlayerColor( Vector(r, g, b) ) -- Here we set the player color.

0 commit comments

Comments
 (0)