Linear gradients now parse color names

Also:
- Cleans up color stop and linear gradient regular expressions.
- Handles percentage-based linear gradient positions (fixes Firefox).

Fixes niklasvh/html2canvas#469.
This commit is contained in:
MoyuScript
2015-01-20 17:29:42 +01:00
parent d8eff23c94
commit 3fac0e78ed
7 changed files with 141 additions and 30 deletions

View File

@ -112,10 +112,13 @@
.linearGradient8 {
background: linear-gradient(to top left, #fff 0%, #00263c 100%);
}
.linearGradient9 {
background: linear-gradient(to top left, white 0%, black 100%);
}
.linearGradient10 {
background: linear-gradient(to left top, #0000Ff, rgb(255, 0,0) 50px, green 199px, rgba(0, 0, 0, 0.5) 100.0%);
}
</style>
</head>
@ -130,6 +133,7 @@
<div class="linearGradient7">&nbsp;</div>
<div class="linearGradient8">&nbsp;</div>
<div class="linearGradient9">&nbsp;</div>
<div class="linearGradient10">&nbsp;</div>
</div>
</body>
</html>