PLOT_backup_functions.py 文件源码

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

项目:polo_robot 作者: kmarci9 项目源码 文件源码
def diffcolorhex(rownum):
    """
    uses predefined lookup table to return distinct colors
    """
    readFile = open('hex_colors.txt', 'r')
    sepFile = readFile.read().split('\n')
    readFile.close()
    x = []
    for plotPair in sepFile:
        k = list(colors.hex2color(plotPair))
        # print(list(k))
        x.append(k)
    if rownum > len(x):
        rownumf = len(x) - 1
        print('rownum: %s exceeds length of colors: %s' % (rownum, len(x)))
    else:
        rownumf = rownum
    return (x[rownumf])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号