From 45d9f749e2378392c5d16638541df43703750576 Mon Sep 17 00:00:00 2001
From: Aaron Krajeski Once a gradient has been created (see below), stops are placed along it to
define how the colors are distributed along the gradient. 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 RGBA space without premultiplying the
- alpha value to find the color to use at that offset. Before the first stop, the color must be the
+ the alpha component must be linearly interpolated over the
+ ColorInterpolationMethod color space to find the color to use at that offset. Color values are premultiplied by alpha if the HueInterpolationMethod. 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 transparent black. There are three types of gradients, linear gradients, radial gradients, and conic gradients,
- represented by objects implementing the opaque
CanvasGradient
interface.CanvasGradient
interface.
Once a gradient has been created (see below), stops are placed along it to define how the colors are distributed along the gradient. 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 - ColorInterpolationMethod color space to find the color to use at that offset. Color values are premultiplied by alpha if the HueInterpolationMethod. 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 transparent black.
+ the alpha component must be linearly interpolated over the ColorInterpolationMethod + color space to find the color to use at that offset. Color values are premultiplied by alpha + if the premultipliedAlpha + value is true. For polar color spaces, hue is interpolated according to the + HueInterpolationMethod. 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 transparent black.gradient.addColorStop(offset, color)
DOMException
exception.
- gradient = context.createConicGradient(startAngle, x, y)
gradient.colorInterpolationMethod [ = value ]
Returns a CanvasGradient
object that represents a conic gradient that paints
- clockwise along the rotation around the center represented by the arguments.
Returns the current color space used for interpolation.
+ +Can be set, to change the colorInterpolationMethod + color space.
+ +The color space must be a string. Invalid values are ignored.
+gradient.hueInterpolationMethod [ = value ]
Returns the current hue interpolation method.
+ +Can be set, to change the hueInterpolationMethod.
+ +The method must be a string. Invalid values are ignored.
+gradient.premultipliedAlpha [ = value ]
Returns true if the gradient will interpolate using premultiplied alpha. + Otherwise returns false.
+ +Can be set, to change the premultipliedAlpha + value.
+CanvasGradient
interface.
Once a gradient has been created (see below), stops are placed along it to - define how the colors are distributed along the gradient. 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 ColorInterpolationMethod - color space to find the color to use at that offset. Color values are premultiplied by alpha - if the premultipliedAlpha - value is true. For polar color spaces, hue is interpolated according to the - HueInterpolationMethod. 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 transparent black.
+ define how the colors are distributed along the gradient. 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 ColorInterpolationMethod color space to find the color to + use at that offset. Color values are premultiplied by alpha if the premultipliedAlpha value is true. For polar + color spaces, hue is interpolated according to the HueInterpolationMethod. 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 transparent black.gradient.addColorStop(offset, color)
DOMException
exception.
- gradient.colorInterpolationMethod [ = value ]
gradient.colorInterpolationMethod [ = value ]
Returns the current color space used for interpolation.
+Returns the current color space used for interpolation.
-Can be set, to change the colorInterpolationMethod - color space.
+Can be set, to change the colorInterpolationMethod color space.
-The color space must be a string. Invalid values are ignored.
-The color space must be a string. Invalid values are ignored.
+gradient.hueInterpolationMethod [ = value ]
gradient.hueInterpolationMethod [ = value ]
Returns the current hue interpolation method.
+Returns the current hue interpolation method.
-Can be set, to change the hueInterpolationMethod.
+Can be set, to change the hueInterpolationMethod.
-The method must be a string. Invalid values are ignored.
-The method must be a string. Invalid values are ignored.
+gradient.premultipliedAlpha [ = value ]
gradient.premultipliedAlpha [ = value ]
Returns true if the gradient will interpolate using premultiplied alpha. - Otherwise returns false.
+Returns true if the gradient will interpolate using premultiplied alpha. Otherwise returns false.
-Can be set, to change the premultipliedAlpha - value.
-Can be set, to change the premultipliedAlpha value.
+ +Returns the current color space used for interpolation.
-Can be set, to change the colorInterpolationMethod color space.
- -The color space must be a string. Invalid values are ignored.
+Can be set, to change the space used for color interpolation. Possible values are enumerated + in the ColorInterpolationMethod enum. Other + values are ignored.
gradient.hueInterpolationMethod [ = value ]
Can be set, to change the hueInterpolationMethod.
-The method must be a string. Invalid values are ignored.
+Possible hue interpolation method values are "shorter", "longer", "increasing", or + "decreasing". Other values are ignored.
gradient.premultipliedAlpha [ = value ]
The CanvasGradient
has a colorInterpolationMethod
+ attribute of type ColorInterpolationMethod
, which indicates the
+ CanvasGradient
object's color space for interpolation.
+ Valid values are enumerated in the ColorInterpolationMethod
enumeration.
The CanvasGradient
also has a hueInterpolationMethod
attribute
+ of type HueInterpolationMethod
, which indicates the CanvasGradient
+ object's method for for interpolationing hues in polar color spaces.
+ Valid values are enumerated in the HueInterpolationMethod
enumeration.
Finally, the CanvasGradient
also has a premultipliedAlpha
boolean
+ attribute, which indicates whether the resulting gradient should interpolate using premultiplied alpha.
The createLinearGradient(x0, y0,
x1, y1)
method takes four arguments that represent the start