linebender / linebender/piet

Hue/Chroma preserving value adjustments

Open
#264 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.