Skip to content

Function: setRgb()

ts
function setRgb(color, rgb): Color;

Defined in: setRgb.ts:12

Set the RGB values for a color to specific values.

Parameters

ParameterTypeDescription
colorColorthe color to set the values for
rgb{ b?: number; g?: number; r?: number; }object containing values for r, g, and b. Each value is optional, any values not provided will not be changed
rgb.b?number-
rgb.g?number-
rgb.r?number-

Returns

Color

a new color with the new r, g, and b values