SetFontColor

function SetFontColor(oColor: ApiColor = null): void

Description

Sets the text color to the current cell range with the previously created color object.

Parameters

oColorApiColordefault: null

The color object which specifies the color to be set to the text in the cell / cell range.

Returns

void

Try It

var oWorksheet = Api.GetActiveSheet();
oWorksheet.GetRange("A2").SetFontColor(Api.CreateColorFromRGB(255, 111, 61));
oWorksheet.GetRange("A2").SetValue("This is the text with a color set to it");
oWorksheet.GetRange("A4").SetValue("This is the text with a default color");

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).