Garry's Mod Wiki

HexToColor

  Color HexToColor( string hue )

Recently Added

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

Description

Converts a hexadecimal representation of a color to Color object.

Arguments

1 string hue
A hex formatted color. Accepted formats are:
  • #RRGGBB
  • #RRGGBBAA (Web color standard variation)
  • #RGB
  • #RGBA

# can be omitted.

Returns

1 Color
The Color created from the hexadecimal color code.