Get Started
Documentation

CreateColorFromRGB

CreateColorFromRGB(r, g, b) → {ApiColor}

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

Parameters:

Name Type Description
r byte Red color component value.
g byte Green color component value.
b byte Blue color component value.

Returns:

Type
ApiColor

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
oColor = Api.CreateColorFromRGB(49, 133, 154);
oWorksheet.GetRange("A2").SetValue("Text with color");
oWorksheet.GetRange("A2").SetFontColor(oColor);
builder.SaveFile("xlsx", "CreateColorFromRGB.xlsx");
builder.CloseFile();

Resulting document