--- title: "toHex" description: "Returns a hex formatted string representing the unsigned integer argument." --- # toHex > Returns a hex formatted string representing the unsigned integer argument. **This function is used by Ignition's Expression language.** ## Description Returns a hex formatted string representing the unsigned integer argument. If the argument is negative, the hex string represents the value plus 232. ## Syntax `toHex(number)` ### Parameters | Type | Parameter | Description | |---|---|---| | Integer | `number` | The number to convert to hex. | ### Results **String** - A string that is the hex value of the specified value. `toHex(color)` ### Parameters | Type | Parameter | Description | |---|---|---| | Color | `color` | An RGBA set to convert to hex. | ### Results **String** - A string that is the hex value of the specified value. ## Examples ```python title="Code Snippet" toHex(255) //returns "FF" ``` ```python title="Code Snippet" toHex(-255) //returns "FFFFFF01" ``` ```python title="Code Snippet" toHex(color(192,26,68,241)) //Returns "C01A44F1" ```