Skip to content

Commit

Permalink
Add non normative stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
mysteryDate committed Feb 3, 2025
1 parent 45d9f74 commit dbce039
Showing 1 changed file with 37 additions and 8 deletions.
45 changes: 37 additions & 8 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -68751,15 +68751,18 @@ try {
<hr>

<p>There are three types of gradients, linear gradients, radial gradients, and conic gradients,
represented by objects implementing the opaque <code>CanvasGradient</code> interface.</p>
represented by objects implementing the <code>CanvasGradient</code> interface.</p>

<p id="interpolation">Once a gradient has been created (see below), stops are placed along it to
define how the colors are distributed along the gradient. <span w-nodev>The color of the
gradient at each stop is the color specified for that stop. Between each such stop, the colors and
the alpha component must be linearly interpolated over the
<span data-x="ColorInterpolationMethod">ColorInterpolationMethod</span> color space to find the color to use at that offset. Color values are premultiplied by alpha if the <span data-x="canvas-gradient-premultipliedAlpha>premultipliedAlpha</span> value is true. For polar color spaces, hue is interpolated according to the <span data-x="HueInterpolationMethod">HueInterpolationMethod</span>. Before the first stop, the color must be the
color of the first stop. After the last stop, the color must be the color of the last stop. When
there are no stops, the gradient is <span>transparent black</span>.</span></p>
the alpha component must be linearly interpolated over the <span data-x="ColorInterpolationMethod">ColorInterpolationMethod</span>
color space to find the color to use at that offset. Color values are premultiplied by alpha
if the <span data-x="canvas-gradient-premultipliedAlpha">premultipliedAlpha</span>
value is true. For polar color spaces, hue is interpolated according to the
<span data-x="HueInterpolationMethod">HueInterpolationMethod</span>. Before the first stop, the
color must be the color of the first stop. After the last stop, the color must be the color of the
last stop. When there are no stops, the gradient is <span>transparent black</span>.</span></p>

<dl class="domintro">
<dt><code data-x=""><var>gradient</var>.<span subdfn data-x="dom-canvasgradient-addColorStop">addColorStop</span>(<var>offset</var>, <var>color</var>)</code></dt>
Expand Down Expand Up @@ -68790,10 +68793,36 @@ try {
<code>DOMException</code> exception.</p>
</dd>

<dt><code data-x=""><var>gradient</var> = <var>context</var>.<span subdfn data-x="dom-context-2d-createConicGradient">createConicGradient</span>(<var>startAngle</var>, <var>x</var>, <var>y</var>)</code></dt>
<dt><code data-x=""><var>gradient</var>.<span data-x="ColorInterpolationMethod">colorInterpolationMethod</span> [ = <var>value</var> ]</code></dt>

<dd><p>Returns a <code>CanvasGradient</code> object that represents a conic gradient that paints
clockwise along the rotation around the center represented by the arguments.</p></dd>
<dd>
<p>Returns the current color space used for interpolation.</p>

<p>Can be set, to change the <span data-x="ColorInterpolationMethod">colorInterpolationMethod</span>
color space.</p>

<p>The color space must be a string. Invalid values are ignored.</p>
</dd>

<dt><code data-x=""><var>gradient</var>.<span data-x="HueInterpolationMethod">hueInterpolationMethod</span> [ = <var>value</var> ]</code></dt>

<dd>
<p>Returns the current hue interpolation method.</p>

<p>Can be set, to change the <span data-x="HueInterpolationMethod">hueInterpolationMethod</span>.</p>

<p>The method must be a string. Invalid values are ignored.</p>
</dd>

<dt><code data-x=""><var>gradient</var>.<span data-x="canvas-gradient-premultipliedAlpha">premultipliedAlpha</span> [ = <var>value</var> ]</code></dt>

<dd>
<p>Returns true if the gradient will interpolate using <span data-x="concept-premultiplied-alpha">premultiplied alpha</span>.
Otherwise returns false.</p>

<p>Can be set, to change the <span data-x="canvas-gradient-premultipliedAlpha">premultipliedAlpha</span>
value.</p>
</dd>
</dl>

<div w-nodev>
Expand Down

0 comments on commit dbce039

Please sign in to comment.