moved gradient test location
This commit is contained in:
parent
759a4e89cd
commit
b7a0219680
4 changed files with 128 additions and 14 deletions
|
|
@ -3894,20 +3894,6 @@ svc_1.t2 -> b: do with B
|
|||
tassert.Equal(t, "d2/testdata/d2compiler/TestCompile/meow.d2", g.Layers[0].Layers[0].AST.Range.Path)
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "test-gradient-fill-values-in-sketch-mode",
|
||||
text: `
|
||||
vars: {
|
||||
d2-config: {
|
||||
sketch: true
|
||||
}
|
||||
}
|
||||
x->y
|
||||
x.style.fill: "linear-gradient(#000000, #ffffff)"
|
||||
y.style.fill: "linear-gradient(#ffffff, #000000)"
|
||||
`,
|
||||
expErr: "",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
|
|
|
|||
|
|
@ -1357,6 +1357,14 @@ item -> customer: is(Adult)
|
|||
customer -> item: true
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "test-gradient-fill-values-in-sketch-mode",
|
||||
script: `
|
||||
x->y
|
||||
x.style.fill: "linear-gradient(#000000,#ffffff)"
|
||||
y.style.fill: "linear-gradient(#ffffff,#000000)"
|
||||
`,
|
||||
},
|
||||
}
|
||||
runa(t, tcs)
|
||||
}
|
||||
|
|
|
|||
118
d2renderers/d2sketch/testdata/test-gradient-fill-values-in-sketch-mode/sketch.exp.svg
vendored
Normal file
118
d2renderers/d2sketch/testdata/test-gradient-fill-values-in-sketch-mode/sketch.exp.svg
vendored
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 53 KiB |
|
|
@ -86,6 +86,8 @@ func darkenCSS(colorString string) (string, error) {
|
|||
}
|
||||
|
||||
func LuminanceCategory(colorString string) (string, error) {
|
||||
// check if colorString matches the `url('#grad-<sha1-hash>')` format
|
||||
// which is used to refer to a <linearGradient> or <radialGradient> element.
|
||||
if IsURLGradientID(colorString) {
|
||||
return "normal", nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue