Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

adding support for rgba as a OK {color} #603

Closed
wants to merge 2 commits into from

5 participants

@thor

http://www.w3.org/TR/css3-color/#rgba-color

Note, usage of int on % numbers also taken into account.

Will allow usage of RGBA, thus allowing alpha to be specified on any item where color can be attributed.

thor added some commits
@thor thor adding support for rgba as a OK {color}
http://www.w3.org/TR/css3-color/#rgba-color

Note, usage of int on % numbers also taken into account.
197f161
@thor thor added "transparent" as a valid colour
Valid as per CSS1.

Applicable to all elements accepting color as per CSS3.
http://www.w3.org/TR/css3-color/#transparent
e075815
@thor

Also added "transparent" to the allowed list of values.

Has there been a certain discussion on how come some values are in the filter, and how some aren't?

If so, I'm really sorry for sending this pull request as a waste of time. However, if there hasn't been one.. there certainly are many tags that ought to be added.

Addendum:

I haven't tested this change though, which I certainly could do should that prove it a little bit more beneficial. Judging by the macros used though, it should be quite fine.

@amoliski

Why hasn't this been accepted yet?

@thor

Why hasn't this been accepted yet?

I can only guess, and in which case I would assume it's due to an aim for updating the cssfilter module itself.

Regardless of that, I do believe this should be pulled in the meanwhile, as an update to the cssfilter surely would be more notable change than adding a filter or two.

@dpeukert

Still not accepted :(

@andre-d

Indeed, we are waiting for a library update (last time an update was attempted we tested it and found an infinite loop bug) along with a removal of a lot of these hacks.

@spladug
Owner

Closing because this has been obviated by the replacement of cssutils with tinycss2. Thanks for the contribution and sorry for it not getting merged.

@spladug spladug closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 16, 2012
  1. @thor

    adding support for rgba as a OK {color}

    thor authored
    http://www.w3.org/TR/css3-color/#rgba-color
    
    Note, usage of int on % numbers also taken into account.
  2. @thor

    added "transparent" as a valid colour

    thor authored
    Valid as per CSS1.
    
    Applicable to all elements accepting color as per CSS3.
    http://www.w3.org/TR/css3-color/#transparent
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  r2/r2/lib/cssfilter.py
View
2  r2/r2/lib/cssfilter.py
@@ -63,7 +63,7 @@
# From: http://www.w3.org/TR/2008/WD-css3-color-20080721/#svg-color
'x11color': r'aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen',
- 'csscolor': r'(maroon|red|orange|yellow|olive|purple|fuchsia|white|lime|green|navy|blue|aqua|teal|black|silver|gray|ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText)|#[0-9a-f]{3}|#[0-9a-f]{6}|rgb\({w}{int}{w},{w}{int}{w},{w}{int}{w}\)|rgb\({w}{num}%{w},{w}{num}%{w},{w}{num}%{w}\)',
+ 'csscolor': r'(transparent|maroon|red|orange|yellow|olive|purple|fuchsia|white|lime|green|navy|blue|aqua|teal|black|silver|gray|ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText)|#[0-9a-f]{3}|#[0-9a-f]{6}|rgb\({w}{int}{w},{w}{int}{w},{w}{int}{w}\)|rgb\({w}{num}%{w},{w}{num}%{w},{w}{num}%{w}\)|rgba\({w}{int}{w},{w}{int}{w},{w}{int}{w},{w}{int}{w}\)|rgba\({w}{num}%{w},{w}{num}%{w},{w}{num}%{w},{w}{int}%{w}\)',
'color': '{x11color}|{csscolor}',
'bg-gradient': r'none|{color}|[a-z-]*-gradient\([^;]*\)',
Something went wrong with that request. Please try again.