Skip to main content

@microsoft/fast-colors > calculateOverlayColor

calculateOverlayColor() function

Calculate an overlay color that uses rgba (rgb + alpha) that matches the appearance of a given solid color when placed on the same background

Signature:
export declare function calculateOverlayColor(rgbMatch: ColorRGBA64, rgbBackground: ColorRGBA64, rgbOverlay?: ColorRGBA64): ColorRGBA64;

Parameters

ParameterTypeDescription
rgbMatchColorRGBA64The solid color the overlay should match in appearance when placed over the rgbBackground
rgbBackgroundColorRGBA64The background on which the overlay rests
rgbOverlayColorRGBA64The rgb color of the overlay. Typically this is either pure white or pure black and when not provided will be determined automatically. This color will be used in the returned output
Returns:

ColorRGBA64

The rgba (rgb + alpha) color of the overlay