Skip to content

Commit

Permalink
[css-color-4] More on hue interpolation, #9207
Browse files Browse the repository at this point in the history
  • Loading branch information
svgeesus committed Oct 6, 2023
1 parent 509ebab commit 27dee0c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions css-color-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4938,7 +4938,7 @@ Hue Interpolation</h3>
For example, the midpoint when interpolating in Oklch from a red
<span class="swatch" style="--color: rgb(93.22% 7.98% 0.485%)"></span>&nbsp;oklch(0.6 0.24 30) to a yellow
<span class="swatch" style="--color: rgb(89.07% 72.28% 19.23%)"></span>&nbsp;oklch(0.8 0.15 90)
would be at a hue angle of (30 + 360 + 90) / 2 = 240 degrees,
would be at a hue angle of (30 + 360 + 90) * 0.5 = 240 degrees,
along the longer arc between the two colors,
giving a sky blue
<span class="swatch" style="--color: rgb(0% 66.25% 100%)"></span>&nbsp;oklch(0.7 0.195 240)
Expand Down Expand Up @@ -4973,13 +4973,13 @@ Hue Interpolation</h3>
For example, the midpoint when interpolating in Oklch from a deep brown
<span class="swatch" style="--color: rgb(57.92% 29.44% 25.11%)"></span>&nbsp;oklch(0.5 0.1 30) to a turquoise
<span class="swatch" style="--color: rgb(26.29% 69.89% 67.49%)"></span>&nbsp;oklch(0.7 0.1 190)
would be at a hue angle of (30 + 190) / 2 = 110 degrees,
would be at a hue angle of (30 + 190) * 0.5 = 110 degrees,
giving a khaki
<span class="swatch" style="--color: rgb(51.73% 52.26% 22.03%)"></span>&nbsp;oklch(0.6 0.1 110).

However, if the hue of second color is animated to
However, if the hue of the second color is animated to
<span class="swatch" style="--color: rgb(33.09% 66.63% 81.81%)"></span>&nbsp;oklch(0.7 0.1 230),
the midpoint of the interpolation will be (30 + 230) / 2 = 130 degrees,
the midpoint of the interpolation will be (30 + 230) * 0.5 = 130 degrees,
continuing in the same increasing direction,
giving another green
<span class="swatch" style="--color: rgb(42.44% 54.95% 28.93%)"></span>&nbsp;oklch(0.6 0.1 130)
Expand Down Expand Up @@ -5012,13 +5012,13 @@ Hue Interpolation</h3>
For example, the midpoint when interpolating in Oklch from a deep brown
<span class="swatch" style="--color: rgb(57.92% 29.44% 25.11%)"></span>&nbsp;oklch(0.5 0.1 30) to a turquoise
<span class="swatch" style="--color: rgb(26.29% 69.89% 67.49%)"></span>&nbsp;oklch(0.7 0.1 190)
would be at a hue angle of (30 + 360 + 190) / 2 = 290 degrees,
would be at a hue angle of (30 + 360 + 190) * 0.5 = 290 degrees,
giving a purple
<span class="swatch" style="--color: rgb(49.98% 46.03% 72.08%)"></span>&nbsp;oklch(0.6 0.1 290).

However, if the hue of second color is animated to
However, if the hue of the second color is animated to
<span class="swatch" style="--color: rgb(33.09% 66.63% 81.81%)"></span>&nbsp;oklch(0.7 0.1 230),
the midpoint of the interpolation will be (30 +360 + 230) / 2 = 310 degrees,
the midpoint of the interpolation will be (30 +360 + 230) * 0.5 = 310 degrees,
continuing in the same decreasing direction,
giving another purple
<span class="swatch" style="--color: rgb(57.47% 43.44% 67.8%)"></span>&nbsp;oklch(0.6 0.1 310)
Expand Down

0 comments on commit 27dee0c

Please sign in to comment.