color.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:deb-python-lesscpy 作者: openstack 项目源码 文件源码
def hsl(self, *args):
        """ Translate hsl(...) to color string
        raises:
            ValueError
        returns:
            str
        """
        if len(args) == 4:
            return self.hsla(*args)
        elif len(args) == 3:
            h, s, l = args
            rgb = colorsys.hls_to_rgb(int(h) / 360.0, utility.pc_or_float(l), utility.pc_or_float(s))
            color = (utility.convergent_round(c * 255) for c in rgb)
            return self._rgbatohex(color)
        raise ValueError('Illegal color values')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号