linebender / linebender/color

hwb parsing and rounding

Open
#104 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Rust
Stars
110
Forks
14
Avg merge
16h 45m
Merged PRs (30d)
1

Description

In the WPT, there's a test for parsing `hwb(120 30% 50%)` which says it should return `rgb(77, 128, 77)`.

Instead, it returns `rgb(76, 128, 76)` using this code:

```
let check_color = parse_color(check).unwrap().to_alpha_color::().to_rgba8();
let result_color = parse_color(result).unwrap().to_alpha_color::().to_rgba8();
assert_eq!(check_color, result_color);
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the WPT for parsing `hwb(120 30% 50%)` and trace the `parse_color(...).to_alpha_color::().to_rgba8()` conversion shown in the issue. Compare the rounding behavior with the expected `rgb(77, 128, 77)` result. Done means the implementation produces the WPT value and the relevant test passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.