表面背景属性的不透明度

Opacity on Surface background property

本文关键字:不透明度 属性 背景 表面      更新时间:2023-09-26

以下显示错误

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函数,但它似乎不工作在表面的属性。有人能确认一下,是否有解决办法?

背景颜色需要为字符串。你得到的是一个没有定义的JavaScript函数,因此出现了错误。

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