def generateColorByText(text): s = str(ustr(text)) hashCode = int(hashlib.sha256(s.encode('utf-8')).hexdigest(), 16) r = int((hashCode / 255) % 255) g = int((hashCode / 65025) % 255) b = int((hashCode / 16581375) % 255) return QColor(r, g, b, 100)
qcolor文字生成颜色
猜你喜欢
转载自blog.csdn.net/jacke121/article/details/81023409
今日推荐
周排行