<h1>Chroma Saturation</h1>

<div class="container">
  <div class="box box03">Desaturated</div>
  <div class="box box01">Base Color</div>
  <div class="box box02">Saturated</div>
</div>
* {
  box-sizing: border-box;
}

:root {
  /* font settings */
  font-family: system-ui, sans-serif;
  font-size: 1.2rem;
  /* Base Color Settings */
  --base-color: #663399;
  --saturated: oklch(from var(--base-color) l calc(c / 4) h);
  --desaturated: oklch(from var(--base-color) l calc(c * 4) h);
}

body {
  display: flex;
  flex-direction: column;
  place-items: center;
}

.container {
  display: flex;
  flex-direction: row;
  gap: 1rem;
}

.box {
  inline-size: 200px;
  block-size: 200px;
  border: 1px solid black;

  /* optional */
  display: flex;
  place-content: center;
  align-items: center;
}

.box01 {
  background: var(--base-color);
  color: color-contrast(var(--base-color) vs white, black);
}

.box02 {
  background: var(--desaturated);
  color: color-contrast(var(--desaturated) vs white, black);
}

.box03 {
  background: var(--saturated);
  color: color-contrast(var(--saturated) vs white, black);
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.