GetClassType
Returns a type of the ApiUniColor class.
Syntax
expression.GetClassType();
expression - A variable that represents a ApiUniColor class.
Parameters
This method doesn't have any parameters.
Returns
"uniColor"
Example
Read the class type of a color object used in a shape in a spreadsheet.
// How do I identify what type of color object is applied to a shape in a spreadsheet?
// Confirm the color category by checking its type label in a spreadsheet.
const worksheet = Api.GetActiveSheet();
const presetColor = Api.CreatePresetColor("peachPuff");
const gs1 = Api.CreateGradientStop(presetColor, 0);
const gs2 = Api.CreateGradientStop(Api.RGB(255, 111, 61), 100000);
const fill = Api.CreateLinearGradientFill([gs1, gs2], 5400000);
const stroke = Api.CreateStroke(0, Api.CreateNoFill());
worksheet.AddShape("flowChartOnlineStorage", 60 * 36000, 35 * 36000, fill, stroke, 0, 2 * 36000, 1, 3 * 36000);
const classType = presetColor.GetClassType();
worksheet.SetColumnWidth(0, 15);
worksheet.SetColumnWidth(1, 10);
worksheet.GetRange("A1").SetValue("Class Type = ");
worksheet.GetRange("B1").SetValue(classType);