multicolorfits.hex_complement#

multicolorfits.hex_complement(hexstring)[source]#

Return the complementary hex color (bitwise inverse on the RGB cube).

Examples

>>> hex_complement('#FF0000')
'#00FFFF'
>>> hex_complement('#00FF00')
'#FF00FF'
Parameters:

hexstring (str) – Hexadecimal color such as '#FF0000' (leading # optional).

Returns:

str – Complementary hex color such as '#00FFFF'.

Notes

Used by the legacy inverse display path (replace each layer color with its complement before compositing). Prefer a non-black combine_background when you want a white paper look without flipping hues.