Update version to 1.5.2
This commit is contained in:
+3
-1
@@ -1,4 +1,5 @@
|
||||
from math import sqrt
|
||||
from libs.ustr import ustr
|
||||
import hashlib
|
||||
try:
|
||||
from PyQt5.QtGui import *
|
||||
@@ -74,7 +75,8 @@ def fmtShortcut(text):
|
||||
|
||||
|
||||
def generateColorByText(text):
|
||||
hashCode = hash(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)
|
||||
|
||||
Reference in New Issue
Block a user