def GetColor(ea, what):
    if what not in [ CIC_ITEM, CIC_FUNC, CIC_SEGM ]:
        raise ValueError, "'what' must be one of CIC_ITEM, CIC_FUNC and CIC_SEGM"

    if what == CIC_ITEM:
        return idaapi.get_item_color(ea)

    if what == CIC_FUNC:
        func = idaapi.get_func(ea)
        if func:
            return func.color
        else:
            return DEFCOLOR

    if what == CIC_SEGM:
        seg = idaapi.getseg(ea)
        if seg:
            return seg.color
        else:
            return DEFCOLOR

# color item codes:
Get item color
dataset/ETHPy150Open EiNSTeiN-/idapython/python/idc.py/GetColor