我需要从RGB转换一些颜色,为此,我需要知道matplotlib的颜色图的颜色模型是什么。我最好的猜测是CIELab,但我想知道第四个维度。
import matplotlib
import numpy as np
scale = np.random.rand(500)
matplotlib.cm.viridis(scale)
# output
array([[0.175707, 0.6979 , 0.491033, 1. ],
[0.127568, 0.566949, 0.550556, 1. ],
[0.166383, 0.690856, 0.496502, 1. ],
...,
[0.169646, 0.456262, 0.55803 , 1. ],
[0.139147, 0.533812, 0.555298, 1. ],
[0.120565, 0.596422, 0.543611, 1. ]])