Garry's Mod Wiki

Color:AddLightness

  Color:AddLightness( number lightness )

Recently Added

This was recently added in version (2025.01.23). It might only be available on the Dev Branch right now.

Description

Converts a Color into HSL color space, adds given value to the "lightness" and converts it back into an RGB color.

A slightly more efficient combination of COLOR:GetLightness & COLOR:SetLightness

This is useful to quickly change the lightness of the color without changing hue or saturation, allowing for things like easy theming.

Arguments

1 number lightness
The lightness value to add in range [0, 1]