def get(colorType, delta=0):
global cache__
if type(colorType) == type(0):
colorIndex = colorType
else:
colorIndex = app.prefs.color[colorType]
colorIndex = min(colors - 1, colorIndex + delta)
#colorIndex = colorIndex % colors
r = cache__.get(colorIndex)
if r is not None:
return r
color = curses.color_pair(colorIndex)
if colorType in ('error', 'misspelling'):
color |= curses.A_BOLD | curses.A_REVERSE
cache__[colorIndex] = color
return color
评论列表
文章目录