Skip to content

Commit

Permalink
[css-color-5] Adjustments to edge cases and set notation for hue inte…
Browse files Browse the repository at this point in the history
…rpolation types (#5278)
  • Loading branch information
dbaron authored Jul 15, 2020
1 parent 042223a commit bb236a1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions css-color-5/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -752,37 +752,37 @@ Unless the type of hue interpolation is ''specified'', both angles need to be co
One way to do this is <code><i>θ</i> = ((<i>θ</i> % 360) + 360) % 360</code>.

: ''shorter''
:: Angles are adjusted so that θ₂ - θ₁ ∈ [0, 180). In pseudo-Javascript:
:: Angles are adjusted so that θ₂ - θ₁ ∈ [-180, 180]. In pseudo-Javascript:
<pre>
if (θ₂ - θ₁ >= 180) {
if (θ₂ - θ₁ > 180) {
θ₁ += 360;
}
else if (θ₂ - θ₁ <= -180) {
else if (θ₂ - θ₁ < -180) {
θ₂ += 360;
}
</pre>

: ''longer''
:: Angles are adjusted so that θ₂ - θ₁ ∈ [180, 360). In pseudo-Javascript:
:: Angles are adjusted so that |θ₂ - θ₁|{0, [180, 360)}. In pseudo-Javascript:
<pre>
if (0 < θ₂ - θ₁ < 180) {
θ₁ += 360;
θ₁ += 360;
}
else if (-180 < θ₂ - θ₁ < 0) {
θ₂ += 360;
θ₂ += 360;
}
</pre>

: ''increasing''
:: Angles are adjusted so that θ₂ - θ₁ ∈ [0, 360) and θ₁ ≤ θ₂. In pseudo-Javascript:
:: Angles are adjusted so that θ₂ - θ₁ ∈ [0, 360). In pseudo-Javascript:
<pre>
if (θ₂ < θ₁) {
θ₂ += 360;
}
</pre>

: ''decreasing''
:: Angles are adjusted so that θ₂ - θ₁ ∈ [0, 360) and θ₁ ≥ θ₂. In pseudo-Javascript:
:: Angles are adjusted so that θ₂ - θ₁ ∈ (-360, 0]. In pseudo-Javascript:
<pre>
if (θ₁ < θ₂) {
θ₁ += 360;
Expand Down

0 comments on commit bb236a1

Please sign in to comment.