Get Started
Documentation

CreateRGBColor

CreateRGBColor(r, g, b) → {ApiRGBColor}

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
ApiRGBColor

Example

Copy code
builder.CreateFile("pptx");
var oPresentation = Api.GetPresentation();
var oSlide = oPresentation.GetSlideByIndex(0);
var oRGBColor = Api.CreateRGBColor(255, 164, 101);
oGs1 = Api.CreateGradientStop(Api.CreatePresetColor("lightYellow"), 0);
oGs2 = Api.CreateGradientStop(oRGBColor, 100000);
oFill = Api.CreateRadialGradientFill([oGs1, oGs2]);
oSlide.SetBackground(oFill);
builder.SaveFile("pptx", "CreateRGBColor.pptx");
builder.CloseFile();

Resulting document