Merge branch 'fixed-color-in-range-check'

pull/319/head
aristocratos 2021-06-07 16:38:33 +02:00
commit d4a537d0ec
1 changed files with 3 additions and 3 deletions

View File

@ -1143,9 +1143,9 @@ class Color:
else:
raise ValueError(f'RGB dec should be "0-255 0-255 0-255"')
ct = self.dec[0] + self.dec[1] + self.dec[2]
if ct > 255*3 or ct < 0:
raise ValueError(f'RGB values out of range: {color}')
if not all(0 <= c <= 255 for c in self.dec):
raise ValueError(f'One or more RGB values are out of range: {color}')
except Exception as e:
errlog.exception(str(e))
self.escape = ""