有没有一种方法可以基于它的RGB值而不是下面的片段生成 colored颜色 ?(最好使用比matplotlib更紧凑的模块)
from matplotlib.pyplot import scatter, axis, show
R = float(input('Insert R value: '))
G = float(input('Insert G value: '))
B = float(input('Insert B value: '))
def RGB(R,G,B):
r = R/255
g = G/255
b = B/255
scatter([0],[0],color=(r, g, b), s=1e6)
axis('off')
print('R =', R,'\nG =', G,'\nB =', B)
show()
RGB(R,G,B)
By inserting the values of R=50, G=100, and B=200 the code above will return the following window, which is basically a matplotlib scatter plot with an expanded dot:
Matplotlib是一个巨大的模块,当我try 使用Pyinstaller生成可执行文件时,可执行文件的大小变得非常大.这就是我问你的原因.