diff --git a/coloraide/color.py b/coloraide/color.py index 7160b93f..a7628701 100644 --- a/coloraide/color.py +++ b/coloraide/color.py @@ -1155,7 +1155,7 @@ def average( if out_space is None: out_space = space - if powerless is not None: + if powerless is not None: # pragma: no cover warn_deprecated("The use of 'powerless' with 'average()' is deprecated as it is now always enabled") return average.average( diff --git a/tests/test_average.py b/tests/test_average.py index 9e666f0d..b23ab9d7 100644 --- a/tests/test_average.py +++ b/tests/test_average.py @@ -112,6 +112,19 @@ def test_average_ignore_undefined(self): 'color(srgb 0 0.19608 0.33333)'] ) + def test_average_with_undefined_alpha_result(self): + """Test average when the resulting alpha is undefined.""" + + colors = [ + Color('color(srgb 1 1 0 / none)'), + Color('color(srgb 0 0.50196 0 / none)'), + Color('color(srgb 0 0 1 / none)') + ] + self.assertEqual( + Color.average(colors, space='srgb').to_string(color=True, none=True), + 'color(srgb 0.33333 0.50065 0.33333 / none)' + ) + def test_average_ignore_undefined_alpha_premultiplied(self): """Test averaging ignores undefined."""