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 0 degree angle is at 3 o’clock. This angle increases counter-clockwise.

as_json_str()

Serialize the ConicalGradient object to a JSON string.

as_yaml_str()

Serialize the ConicalGradient object to a YAML string.

center

The center point (Offset) of the gradient (relative to the Layer.offset).

static from_json_str(json_str)

Deserialize a ConicalGradient object from a JSON string.

static from_yaml_str(yaml_str)

Deserialize a ConicalGradient object from a YAML string.

get_color_at(x: int, y: int) SolidColor

A helper function to Generator.render() behavior.

The given x and y values (unsigned) are the coordinate of the pixel in the Layer (relative to Layer.offset).