Skip to main content

GetRoleColor

Returns the RGB color of the specified role.

Syntax

expression.GetRoleColor(name);

expression - A variable that represents a ApiFormRoles class.

Parameters

NameRequired/OptionalData typeDefaultDescription
nameRequiredstringThe role name.

Returns

null | Object

Example

This example shows how to get the color of role.

let doc = editor.GetDocument();
let roles = doc.GetFormRoles();
roles.Add("Customer");
let color = roles.GetRoleColor("Customer");
let paragraph = doc.GetElement(0);
paragraph.AddText("Role color: rgb(" + color.r + ", " + color.g + ", " + color.b + ")");