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
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| schemeColorId | Required | SchemeColorId | The color scheme identifier. |
Returns
Example
Create a scheme color using a theme identifier in a presentation.
// How do I apply a theme color to a shape in a presentation?
// Use a scheme color to fill a shape with a color from the presentation theme in a presentation.
const presentation = Api.GetPresentation();
const slide = presentation.GetSlideByIndex(0);
slide.RemoveAllObjects();
const schemeColor = Api.CreateSchemeColor("dk1");
const fill = Api.CreateSolidFill(schemeColor);
const stroke = Api.CreateStroke(0, Api.CreateNoFill());
const drawing = Api.CreateShape("curvedUpArrow", 300 * 36000, 130 * 36000, fill, stroke);
drawing.SetPosition(608400, 1267200);
slide.AddObject(drawing);