The object containing the red, green, blue, and optionally alpha components.
Optional parameterA: stringOptional alpha parameter as a string. If provided and numeric, it overrides the alpha value in the object.
The formatted RGBA string.
// Returns 'rgba(255, 255, 255, 0.5)'
formatDecimalObjectToRgba({ r: 255, g: 255, b: 255, a: 1 }, '0.5');
// Returns 'rgb(255, 255, 255)'
formatDecimalObjectToRgba({ r: 255, g: 255, b: 255 });
// Returns 'rgba(255, 99, 71, 0.6)' (alpha rounded to one decimal place)
formatDecimalObjectToRgba({ r: 255, g: 99, b: 71, a: 0.645343434232323 });
Formats a HexDecimalObject to an RGBA string.