def METHOD_NAME(self, name):
    try:
        if isinstance(name, dict):
            return name
        result = {}
        if name.lower() == "wal":
            wal = self.__load_json("~/.cache/wal/colors.json")
            for field in ["special", "colors"]:
                for key in wal.get(field, {}):
                    result[key] = wal[field][key]
        if name.lower() == "xresources":
            for key in ("background", "foreground"):
                result[key] = xresources.query(key)
            for i in range(16):
                key = color + str(i)
                result[key] = xresources.query(key)
        return result
    except Exception as e:
        log.error("failed to load colors: {}", e)