geepillow.colors#

Module to handle colors.

Attributes#

Classes#

Color

Color class to handle colors.

Functions#

color_from_string(string)

Create a Color from a string.

create(color)

Color dispatcher.

Module Contents#

class geepillow.colors.Color(red, green, blue)[source]#

Color class to handle colors.

Parameters:
  • red (int)

  • green (int)

  • blue (int)

__repr__()[source]#

String representation of the color.

classmethod from_hex(hex_color)[source]#

Create a color instance from hex.

Parameters:

hex_color (str)

classmethod from_hsv(hue, saturation, value)[source]#

Create a color instance from HSV values.

Parameters:
  • hue (float)

  • saturation (float)

  • value (float)

hex(opacity=1.0)[source]#

Hex string of the color.

Parameters:

opacity (float)

Return type:

str

hsv()[source]#

Compute Hue Saturation and Value (HSV space).

Return type:

tuple

rgb()[source]#

RGB of the color.

Return type:

tuple

blue[source]#
green[source]#
red[source]#
geepillow.colors.color_from_string(string)[source]#

Create a Color from a string.

Accepts some common name like ‘red’ and if not in the common list, it will treat it as an hex color string.

Parameters:

string (str)

Return type:

Color

geepillow.colors.create(color)[source]#

Color dispatcher.

Create a color according to the type of the object passed.

Parameters:

color (str | list | Color) – can be a string, a list (R,G,B) or a Color instance

Return type:

Color

geepillow.colors.COMMON[source]#