diff --git a/include/gal/color4d.h b/include/gal/color4d.h index 4e0c0f4ae1..ebcf333bcc 100644 --- a/include/gal/color4d.h +++ b/include/gal/color4d.h @@ -223,6 +223,19 @@ public: a ); } + /** + * Function WithAlpha + * Returns a colour with the same colour, but the given alpha + * @param aAlpha specifies the alpha of the new color + * @return COLOR4D color with that alpha + */ + COLOR4D WithAlpha( double aAlpha ) const + { + assert( aAlpha >= 0.0 && aAlpha <= 1.0 ); + + return COLOR4D( r, g, b, aAlpha ); + } + /** * Function Inverted * Returns an inverted color, alpha remains the same.