colorblind.py 文件源码

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

项目:colorblind 作者: drammock 项目源码 文件源码
def sequential_colormap(x):
    from numpy import array
    from scipy.special import erf
    x = array(x)
    if any(x < 0) or any(x > 1):
        raise ValueError('x must be between 0 and 1 inclusive.')
    red = 1.000 - 0.392 * (1 + erf((x - 0.869) / 0.255))
    grn = 1.021 - 0.456 * (1 + erf((x - 0.527) / 0.376))
    blu = 1.000 - 0.493 * (1 + erf((x - 0.272) / 0.309))
    return array([red, grn, blu]).T
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号