How to use the lesscpy.lessc.utility.away_from_zero_round function in lesscpy

To help you get started, we’ve selected a few lesscpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lesscpy / lesscpy / lesscpy / plib / call.py View on Github external
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)
github lesscpy / lesscpy / lesscpy / lessc / color.py View on Github external
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)