Linear Gradient¶
-
class img_gen.LinearGradient(colors: ColorGradient, start: Offset, end: Offset, spread: Spread =
Spread.Pad)¶ –
A data structure to represent a linear gradient
- as_json_str()¶
Serialize the
LinearGradientobject to a JSON string.
- as_yaml_str()¶
Serialize the
LinearGradientobject to a YAML string.
- static from_json_str(json_str)¶
Deserialize a
LinearGradientobject from a JSON string.
- static from_yaml_str(yaml_str)¶
Deserialize a
LinearGradientobject 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).