in src/pathpicker/color_printer.py [0:0]
def get_attributes(self, fg_color: int, bg_color: int, other: int) -> int:
color_index = -1
color_pair = (fg_color, bg_color)
if color_pair not in self.colors:
new_index = len(self.colors)
if new_index < self.curses_api.get_color_pairs():
self.curses_api.init_pair(new_index, fg_color, bg_color)
self.colors[color_pair] = new_index
color_index = new_index
else:
color_index = self.colors[color_pair]
attr = self.curses_api.color_pair(color_index)
attr = attr | other
return attr