cape.color
: Color conversion tools¶
cape.color
: Color Conversion Tools¶
This module contains tools to convert color strings to RGB values. The
primary tool is to get a variety of colors via name (instead of just
'r'
, 'g'
, 'b'
, 'c'
, 'm'
, 'y'
, 'k'
, and
'w'
). However, there additional tools to convert a hex code to RGB
and vice-versa.
- cape.color.Hex2RGB(col)¶
Convert hex-code color to RGB values
- cape.color.RGB2Hex(col)¶
Convert RGB integer values to a hex code
- cape.color.ToRGB(col)¶
Convert generic value to RGB
- Call:
>>> rgb = ToRGB(col) >>> rgb = ToRGB(hx) >>> rgb = ToRGB(cname) >>> rgb = ToRGB(rgb) >>> rgb = ToRGB(RGB)
- Inputs:
- Outputs:
- Versions:
2017-01-05
@ddalle
: v1.02023-12-11
@ddalle
: v1.1; modern type checks