mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
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:
@ -9,6 +9,15 @@ describe("Gradients", function() {
|
||||
" rgb(0, 255, 0)"
|
||||
]
|
||||
},
|
||||
{
|
||||
method: "linear-gradient",
|
||||
args: [
|
||||
"left",
|
||||
" red",
|
||||
" rgb(255, 255, 0)",
|
||||
" rgb(0, 255, 0)"
|
||||
]
|
||||
},
|
||||
{
|
||||
method: 'linear-gradient',
|
||||
args: [
|
||||
@ -23,6 +32,20 @@ describe("Gradients", function() {
|
||||
" rgb(38, 85, 139) 100%"
|
||||
]
|
||||
},
|
||||
{
|
||||
method: 'linear-gradient',
|
||||
args: [
|
||||
"left",
|
||||
" rgb(206, 219, 233) 0%",
|
||||
" rgb(170, 197, 222) 17px",
|
||||
" rgb(97, 153, 199) 50%",
|
||||
" rgb(58, 132, 195) 51px",
|
||||
" rgb(65, 154, 214) 59%",
|
||||
" rgb(75, 184, 240) 71px",
|
||||
" rgb(58, 139, 194) 84%",
|
||||
" rgb(38, 85, 139) 100px"
|
||||
]
|
||||
},
|
||||
{
|
||||
method: "gradient",
|
||||
args: [
|
||||
@ -35,6 +58,20 @@ describe("Gradients", function() {
|
||||
" to(rgb(191, 110, 78))"
|
||||
]
|
||||
},
|
||||
{
|
||||
method: "gradient",
|
||||
args: [
|
||||
"linear",
|
||||
" 50% 0%",
|
||||
" 50% 100%",
|
||||
" from(rgb(255, 0, 0))",
|
||||
" color-stop(0.314159, green)",
|
||||
" color-stop(0.51, rgb(0, 0, 255))",
|
||||
// temporary workaround for Blink/WebKit bug: crbug.com/453414
|
||||
//" to(rgba(0, 0, 0, 0.5))"
|
||||
" to(rgba(0, 0, 0, 0))"
|
||||
]
|
||||
},
|
||||
{
|
||||
method: 'linear-gradient',
|
||||
args: [
|
||||
|
Reference in New Issue
Block a user