def color_attr():
idx = [0]
def next_color():
possible = sorted(curses_colors.CURSES_COLORPAIRS.keys())
key = possible[idx[0]]
val = curses_colors.CURSES_COLORPAIRS[key]
cp = curses.color_pair(val)
idx[0] = (idx[0] + 1) % len(possible)
return cp
return next_color
评论列表
文章目录