diff --git a/mods/ENVIRONMENT/mcl_weather/skycolor.lua b/mods/ENVIRONMENT/mcl_weather/skycolor.lua index 19cec9eac..fdf7c33c8 100644 --- a/mods/ENVIRONMENT/mcl_weather/skycolor.lua +++ b/mods/ENVIRONMENT/mcl_weather/skycolor.lua @@ -190,8 +190,8 @@ end function skycolor_utils.convert_to_rgb(minval, maxval, current_val, colors) -- Clamp current_val to valid range - current_val = math.min(minval, current_val) - current_val = math.max(maxval, current_val) + current_val = math.max(minval, current_val) + current_val = math.min(maxval, current_val) -- Rescale current_val from a number between minval and maxval to a number between 1 and #colors local scaled_value = (current_val - minval) / (maxval - minval) * (#colors - 1) + 1.0