CSS relative colors

css

Adam Argyle article

Lighten a color by 25%

.lighten-by-25 {
  background: oklch(from blue calc(l * 1.25) c h);
}

Darken a color by 25%

.darken-by-25 {
  background: oklch(from blue calc(l * 0.75) c h);
}