Code crashes when creating a Frame using the linear-gradient CSS function
Gumball12 opened this issue · comments
shj commented
Describe the bug
Code crashes when creating a Scene.Frame
using the linear-gradient()
CSS function. Am I using it wrong?
To Reproduce
new Scene.Frame({
"mask-image": {
prefix: "linear-gradient(",
// If the suffix item is removed, no error occurs
suffix: ")", // <- Uncaught Error: invalid format
model: "linear-gradient",
type: "",
separator: ",",
value: [
{
prefix: "",
suffix: "",
model: "",
type: "array",
separator: " ",
value: ["to", "left"]
},
{
prefix: "",
suffix: "",
model: "",
type: "array",
separator: " ",
value: ["transparent", "40%"]
},
{
prefix: "",
suffix: "",
model: "",
type: "array",
separator: " ",
value: ["black", "60%"]
}
]
}
});
Expected behavior
no error should occur
Desktop (please complete the following information):
- OS: macOS
- Browser: chrome
- Version: 104.0.5112.101
Daybrush (Younkue Choi) commented
Use linear-gradient(to left, transparent 40%, black 60%)
Can you tell me why I'm using it in the following way instead of using ?
shj commented
I was trying to get the properties
property from the Frame
object and use it.
Now I've found that is wrong, and I'm using toCSSObject()
instead(same as you said). Thanks!