Hue/Chroma preserving value adjustments
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.4k
- Forks
- 98
- PR merge metrics
- No merged PRs in 30d
Description
It would be great to have `Color::as_hlc()` and `Color::as_hlca`. It would be useful shifting luminance while preserving hue and chroma. Those adjustments could be added to `Color`, something along the lines of:
```
fn lighter(&self, factor: f64) -> Color {
let (h, l, c) = self.as_hlc();
Color::hlc(h, l * factor, c)
}
fn darker(&self, factor: f64) -> Color {
let (h, l, c) = self.as_hlc();
Color::hlc(h, l / factor, c)
}
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Color type and its existing color-conversion entry points. Check how HLC and HLCA values are represented, then assess the requested as_hlc(), as_hlca(), lighter(), and darker() behavior. Done means the conversions and hue/chroma-preserving luminance adjustments are available on Color with behavior covered by the project's existing validation approach.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100