Skip to content

[css-color-5] Clarification on resolved value of the alpha() function #13994

@weinig

Description

@weinig

The computed value serialization of the newly added alpha() RCS function seem inconsistent, and I am not sure why they are doing what they are doing.

When currentcolor is not involved, the tests require that legacy color serialization is maintained.

test_computed_value("color", "alpha(from red / 0.5)", "rgba(255, 0, 0, 0.5)");

But, when currentcolor is involved, it seems to use color() function syntax for serialization, even though the currentColor resolves to a legacy color.

function test_currentcolor_alpha(specified, expected, current) {
    target.style["color"] = current;
    fuzzy_test_computed_color_property("background-color", specified, expected);
}

test_currentcolor_alpha("alpha(from currentcolor / 0.5)", "color(srgb 1 0 0 / 0.5)", "red");

Is there a rule I am missing that specifies one vs. another?

cc @svgeesus

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions