gpt4 book ai didi

javascript - Surface 背景属性的不透明度

转载 作者:行者123 更新时间:2023-11-30 10:15:36 26 4
gpt4 key购买 nike

下面给了我错误

var textSurface = new Surface({
content: 'Some text here',
properties:{
color: 'white',
backgroundColor: rgba(0,0,0,0.7)
}
});

Uncaught ReferenceError: rgba is not defined

我的目标是仅在背景色上保留设置不透明度的文本颜色。 rgba 用作 css 函数,但它似乎不适用于 surface 的属性。有人可以确认吗?是否有解决方法?

最佳答案

背景颜色需要是一个字符串。您拥有的是未定义的实际 JavaScript 函数,因此会出现错误。

backgroundColor: "rgba(0,0,0,0.7)"

关于javascript - Surface 背景属性的不透明度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23922727/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com