tools/style_variable_generator/css_generator.py
def _CSSColor(self, c):
        '''Returns the CSS color representation of |c|'''
        assert (isinstance(c, Color))
        if c.var:
            return 'var(%s)' % self.ToCSSVarName(c.var)

        if c.rgb_var:
            if c.opacity.a != 1:
                return 'rgba(var(%s-rgb), %g)' % (self.ToCSSVarName(
                    c.RGBVarToVar()), self._CSSOpacity(c.opacity))
            else:
                return 'rgb(var(%s-rgb))' % self.ToCSSVarName(c.RGBVarToVar())

        elif c.a != 1:
            return 'rgba(%d, %d, %d, %g)' % (c.r, c.g, c.b,
                                             self._CSSOpacity(c.opacity))
        else:
            return 'rgb(%d, %d, %d)' % (c.r, c.g, c.b)
Returns the CSS color representation of |c|
Returns the CSS color representation of |c|
Returns the CSS color representation of |c|
def _CSSColor(self, c):
        assert (isinstance(c, Color))
        if c.var:
            return 'var(%s)' % self.ToCSSVarName(c.var)
        if c.rgb_var:
            if c.opacity.a != 1:
                return 'rgba(var(%s-rgb), %g)' % (self.ToCSSVarName(
                    c.RGBVarToVar()), self._CSSOpacity(c.opacity))
            else:
                return 'rgb(var(%s-rgb))' % self.ToCSSVarName(c.RGBVarToVar())
        elif c.a != 1:
            return 'rgba(%d, %d, %d, %g)' % (c.r, c.g, c.b,
                                             self._CSSOpacity(c.opacity))
        else:
            return 'rgb(%d, %d, %d)' % (c.r, c.g, c.b)
def _CSSColor ( self , c ) : assert ( isinstance ( c , Color ) ) if c . var : return 'var(%s)' % self . ToCSSVarName ( c . var ) if c . rgb_var : if c . opacity . a != 1 : return 'rgba(var(%s-rgb), %g)' % ( self . ToCSSVarName ( c . RGBVarToVar ( ) ) , self . _CSSOpacity ( c . opacity ) ) else : return 'rgb(var(%s-rgb))' % self . ToCSSVarName ( c . RGBVarToVar ( ) ) elif c . a != 1 : return 'rgba(%d, %d, %d, %g)' % ( c . r , c . g , c . b , self . _CSSOpacity ( c . opacity ) ) else : return 'rgb(%d, %d, %d)' % ( c . r , c . g , c . b )
Returns the CSS color representation of |c|
Returns the CSS color representation of |c|
'''Returns the CSS color representation of |c|'''
self
c