BackgroundLayer

背景图层其实也是一种普通图层,只不过他会充满整个窗口,因此它会覆盖整个画布。如果一个背景图层还有父图层,那么他就会继承父级图层的尺寸。

  1. layerA = new BackgroundLayer
  2. backgroundColor: "white"

你可以通过backgroundColor给其定义一个背景色,支持rgb和hex色值。

  1. # Hex value for white
  2. layerA = new BackgroundLayer
  3. backgroundColor: "#ffffff"
  4. # RGB value for white
  5. layerA = new BackgroundLayer
  6. backgroundColor: "rgb(255,255,255)"
  7. # RGBA value for white
  8. layerA = new BackgroundLayer
  9. backgroundColor: "rgba(255,255,255,1)"