diff --git a/bpytop.py b/bpytop.py index d016bba..0f0647e 100755 --- a/bpytop.py +++ b/bpytop.py @@ -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 = ""