1

The following gave me error

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

Uncaught ReferenceError: rgba is not defined

My goal is to keep the text color with set opacity only on the background color. rgba works as a css function but it doesn't seem to work in surface's property. Can someone confirm and if there is a workaround?

HP.
  • 19,226
  • 53
  • 154
  • 253

1 Answers1

4

The background color needs to be a string. What you have is an actual JavaScript function that is not defined, hence the error.

backgroundColor: "rgba(0,0,0,0.7)"
Explosion Pills
  • 188,624
  • 52
  • 326
  • 405