Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def round(self, value, *args):
""" Round number
args:
value (str): target
returns:
str
"""
n, u = utility.analyze_number(value)
return utility.with_unit(
int(utility.away_from_zero_round(float(n))), u)
def _ophsl(self, color, diff, idx, operation):
if isinstance(diff, string_types):
diff = float(diff.strip('%'))
hls = list(self._hextohls(color))
hls[idx] = self._clamp(operation(hls[idx], diff / 100.0))
rgb = colorsys.hls_to_rgb(*hls)
color = (utility.away_from_zero_round(c * 255) for c in rgb)
return self._rgbatohex(color)