跳到主要内容

CreateSchemeColor

Creates a complex color scheme selecting from one of the available schemes.

Syntax

expression.CreateSchemeColor(schemeColorId);

expression - A variable that represents a Api class.

Parameters

NameRequired/OptionalData typeDefaultDescription
schemeColorIdRequiredSchemeColorIdThe color scheme identifier.

Returns

ApiSchemeColor

Example

This example shows how to create a scheme color with the 'dk1' identifier.

// How to create a new scheme color.

// Add a scheme color to create a solid fill.

const doc = Api.GetDocument();
const page = doc.GetPage(0);

const schemeColor = Api.CreateSchemeColor("dk1");
const fill = Api.CreateSolidFill(schemeColor);
const stroke = Api.CreateStroke(0, Api.CreateNoFill());
const drawing = Api.CreateShape("curvedUpArrow", 150 * 36000, 65 * 36000, fill, stroke);
drawing.SetPosition(608400, 1267200);
page.AddObject(drawing);