sciris.sc_colors.rgb2hex

rgb2hex(arr)[source]

A little helper function to convert e.g. [0.53, 0.74, 0.15] to a pleasing shade of green.

Example:

hx = sc.rgb2hex([0.53, 0.74, 0.15]) # Returns '#87bc26'