def compress_hex(color):
    """Compress hex."""

    m = HEX_COMPRESS_RE.match(color)
    if m:
        color = '#' + m.group(1) + m.group(2) + m.group(3)
        if m.group(4):
            color += m.group(4)
    return color
dataset/ETHPy150Open facelessuser/ColorHelper/color_helper_util.py/compress_hex/original