Fill
Describes how a fill is filled with color or media.
If both media
and color
are defined, media
takes precedence.
Properties
mediaContainer
object
Read-onlyRequiredA media fill, if any.
set
function
RequiredParameters
state
undefined | MediaFillState
RequiredA state that creates an image fill.
type
string
Read-onlyRequiredThe type of media.
This must be "image"
.
imageRef
ImageRef
Read-onlyRequiredA unique identifier that points to an image asset in Canva's backend.
flipX
boolean
RequiredIf true
, the image is flipped horizontally.
flipY
boolean
RequiredIf true
, the image is flipped vertically.
A state that creates a video fill.
type
string
Read-onlyRequiredThe type of media.
This must be "video"
.
videoRef
VideoRef
Read-onlyRequiredA unique identifier that points to a video asset in Canva's backend.
flipX
boolean
RequiredIf true
, the video is flipped horizontally.
flipY
boolean
RequiredIf true
, the video is flipped vertically.
Returns
void
ref
undefined | MediaFill
RequiredAn image that fills the interior of a media.
type
string
Read-onlyRequiredThe type of media.
This must be "image"
.
imageRef
ImageRef
Read-onlyRequiredA unique identifier that points to an image asset in Canva's backend.
flipX
boolean
RequiredIf true
, the image is flipped horizontally.
flipY
boolean
RequiredIf true
, the image is flipped vertically.
A video that fills the interior of a media.
type
string
Read-onlyRequiredThe type of media.
This must be "video"
.
videoRef
VideoRef
Read-onlyRequiredA unique identifier that points to a video asset in Canva's backend.
flipX
boolean
RequiredIf true
, the video is flipped horizontally.
flipY
boolean
RequiredIf true
, the video is flipped vertically.
colorContainer
object
Read-onlyRequiredA color fill, if any.
set
function
RequiredParameters
state
undefined | SolidFillState
Requiredtype
string
Read-onlyRequiredThe type of color.
This must be "solid"
.
color
string
RequiredThe color of the fill.
This must be a valid, six-digit hex code, prefixed with a #
symbol.
- Must be six characters long.
- Must start with a
#
. - Must use lowercase letters.
Example
"#ff0099"
Returns
void
ref
undefined | ColorFill
RequiredA solid color that fills an interior.
type
string
Read-onlyRequiredThe type of color.
This must be "solid"
.
color
string
RequiredThe color of the fill.
This must be a valid, six-digit hex code, prefixed with a #
symbol.
- Must be six characters long.
- Must start with a
#
. - Must use lowercase letters.
Example
"#ff0099"
Represents something that's not supported by the Apps SDK.
type
string
Read-onlyRequiredThis must be "unsupported"
.