Skip to content

Commit

Permalink
feat(commons): deprecate flattenShadowColors in favor of flattenColors (
Browse files Browse the repository at this point in the history
  • Loading branch information
WilcoFiers authored Dec 5, 2022
1 parent 9e1e31b commit af49daf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/commons/color/flatten-shadow-colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import Color from './color';

/**
* Combine the two given shadow colors according to alpha blending.
* @deprecated Use axe.commons.color.flattenColors instead
* @method flattenColors
* @memberof axe.commons.color.Color
* @instance
* @param {Color} fgColor Foreground color
* @param {Color} bgColor Background color
* @return {Color} Blended color
*/
function flattenColors(fgColor, bgColor) {
export default function flattenShadowColors(fgColor, bgColor) {
var alpha = fgColor.alpha;
var r = (1 - alpha) * bgColor.red + alpha * fgColor.red;
var g = (1 - alpha) * bgColor.green + alpha * fgColor.green;
Expand All @@ -18,5 +19,3 @@ function flattenColors(fgColor, bgColor) {

return new Color(r, g, b, a);
}

export default flattenColors;

0 comments on commit af49daf

Please sign in to comment.