Conical Gradient¶
-
class img_gen.ConicalGradient(colors: ColorGradient, center: Offset, angle: float =
0)¶ –
A data structure to represent a conical gradient.
- angle¶
The starting angle (in degrees) of the gradient.
A
0degree angle is at 3 o’clock. This angle increases counter-clockwise.
- as_json_str()¶
Serialize the
ConicalGradientobject to a JSON string.
- as_yaml_str()¶
Serialize the
ConicalGradientobject to a YAML string.
- center¶
The center point (
Offset) of the gradient (relative to theLayer.offset).
- static from_json_str(json_str)¶
Deserialize a
ConicalGradientobject from a JSON string.
- static from_yaml_str(yaml_str)¶
Deserialize a
ConicalGradientobject 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).