culour.py 文件源码

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

项目:culour 作者: shohamp 项目源码 文件源码
def _get_color(fg, bg):
    key = (fg, bg)
    if key not in COLOR_PAIRS_CACHE:
        # Use the pairs from 101 and after, so there's less chance they'll be overwritten by the user
        pair_num = len(COLOR_PAIRS_CACHE) + 101
        curses.init_pair(pair_num, fg, bg)
        COLOR_PAIRS_CACHE[key] = pair_num

    return COLOR_PAIRS_CACHE[key]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号