Skip to main content
Platform
Language

Color

In this example, we will show you how to use the CreativeEditor SDK's CreativeEngine to modify a fill block's solid color through the block API.

Setup#

This example uses the headless CreativeEngine. See the Setup article for a detailed guide. To get started right away, you can also access the block API within a running CE.SDK instance via cesdk.engine.block. Check out the APIs Overview to see that illustrated in more detail.

setColor(id: DesignBlockId, property: string, value: Color): void

Set a color property of the given design block to the given value.

  • id: The block whose property should be set.
  • property: The name of the property to set.
  • value: The value to set.
getColor(id: DesignBlockId, property: string): Color

Get the value of a color property of the given design block.

  • id: The block whose property should be queried.
  • property: The name of the property to query.
  • Returns The value of the property.