Hex to RGB

Convert a hex color code to RGB values.

Code

Utilities
h = hex.lstrip('#')
return {'r': int(h[0:2], 16), 'g': int(h[2:4], 16), 'b': int(h[4:6], 16)}

Parameters

The hex color code.

Server

More Python Snippets