Radial Gradient¶
-
class img_gen.RadialGradient(colors: ColorGradient, center: Offset, radius: float, focal_point: Offset | None =
None, focal_radius: float | None =None, spread: Spread =Spread.Pad)¶ –
A data structure to represent a radial gradient.
- as_json_str()¶
Serialize the
RadialGradientobject to a JSON string.
- as_yaml_str()¶
Serialize the
RadialGradientobject to a YAML string.
- center¶
The center (
Offset) of the gradient (relative to theLayer.offset).
- focal_point¶
The focal point (
Offset) of the gradient (relative to theLayer.offset).
- focal_radius¶
Returns the focal radius.
- static from_json_str(json_str)¶
Deserialize a
RadialGradientobject from a JSON string.
- static from_yaml_str(yaml_str)¶
Deserialize a
RadialGradientobject from a YAML string.
- get_color_at(x: int, y: int) SolidColor¶
–
A helper function to
Generator.render()behavior.The given
xandyvalues (unsigned) are the coordinate of the pixel in theLayer(relative toLayer.offset).
- radius¶
The radius of the gradient.