CreateColorFromRGB

function CreateColorFromRGB(r: byte = null, g: byte = null, b: byte = null): ApiColor

Description

Creates an RGB color setting the appropriate values for the red, green and blue color components.

Parameters

rbytedefault: null

Red color component value.

gbytedefault: null

Green color component value.

bbytedefault: null

Blue color component value.

Returns

ApiColor

Try It

var oWorksheet = Api.GetActiveSheet();
var oColor = Api.CreateColorFromRGB(255, 111, 61);
oWorksheet.GetRange("A2").SetValue("Text with color");
oWorksheet.GetRange("A2").SetFontColor(oColor);

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).