color.py 文件源码

python
阅读 37 收藏 0 点赞 0 评论 0

项目:ci_edit 作者: google 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号