Garry's Mod Wiki

Color:GetLightness

  number Color:GetLightness()

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 and returns the "lightness" of the color.

See COLOR:ToHSL if you want to get all 3 components.

Returns

1 number lightness
Lightness in range [0, 1]