Skip to content

Color function values are not properly rounded #134

@cdoublev

Description

@cdoublev

This test expectation is wrong:

style.color = 'rgba(5%, 10%, 20%, 0.4)';
expect(style.color).toEqual('rgba(12, 25, 51, 0.4)');

In Chrome/Firefox:

target.style.backgroundColor = 'rgba(5%, 10%, 20%, 0.4)'
console.log(target.style.backgroundColor) // "rgba(13, 26, 51, 0.4)"

Spec:

Implementations should honor the precision of the channel as authored or calculated wherever possible. If this is not possible, the channel should be rounded towards +∞.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions