Skip to main content

SetRoleColor

Sets the color for the specified role.

Syntax

expression.SetRoleColor(name, color);

expression - A variable that represents a ApiFormRoles class.

Parameters

NameRequired/OptionalData typeDefaultDescription
nameRequiredstringThe role name.
colorRequiredstringThe role color.

Returns

boolean

Example

This example shows how to change the color of role.

let doc = editor.GetDocument();
let roles = doc.GetFormRoles();
roles.Add("Customer");
roles.SetRoleColor("Customer", "#C6E0B3");
doc.InsertTextForm({key : "Name", role : "Customer", placeholder : "Enter your name"});