Skip to main content

GetClassType

Returns a type of the ApiColor class.

Syntax

expression.GetClassType();

expression - A variable that represents a ApiColor class.

Parameters

This method doesn't have any parameters.

Returns

"color"

Example

Retrieve the class type of a color object in a document.

// How do I identify what kind of color object is used in a document?

// Useful when you need to confirm the object type before processing color properties.

const doc = Api.GetDocument();
const color = Api.ThemeColor('accent1');
const paragraph = doc.GetElement(0);
paragraph.AddText('Class type of ApiColor instance: ' + color.GetClassType());