Skip to content

Coloring

momapy.coloring

Classes and objects for defining colors

Classes:

Name Description
Color

Class for colors

Functions:

Name Description
has_color

Return true if a color with the given name is available, false otherwise

list_colors

List all available named colors

print_colors

Print all available named colors

Attributes:

Name Type Description
aliceblue

The color aliceblue | aliceblue

antiquewhite

The color antiquewhite | antiquewhite

aqua

The color aqua | aqua

aquamarine

The color aquamarine | aquamarine

azure

The color azure | azure

beige

The color beige | beige

bisque

The color bisque | bisque

black

The color black | black

blanchedalmond

The color blanchedalmond | blanchedalmond

blue

The color blue | blue

blueviolet

The color blueviolet | blueviolet

brown

The color brown | brown

burlywood

The color burlywood | burlywood

cadetblue

The color cadetblue | cadetblue

chartreuse

The color chartreuse | chartreuse

chocolate

The color chocolate | chocolate

coral

The color coral | coral

cornflowerblue

The color cornflowerblue | cornflowerblue

cornsilk

The color cornsilk | cornsilk

crimson

The color crimson | crimson

cyan

The color cyan | cyan

darkblue

The color darkblue | darkblue

darkcyan

The color darkcyan | darkcyan

darkgoldenrod

The color darkgoldenrod | darkgoldenrod

darkgray

The color darkgray | darkgray

darkgreen

The color darkgreen | darkgreen

darkgrey

The color darkgrey | darkgrey

darkkhaki

The color darkkhaki | darkkhaki

darkmagenta

The color darkmagenta | darkmagenta

darkolivegreen

The color darkolivegreen | darkolivegreen

darkorange

The color darkorange | darkorange

darkorchid

The color darkorchid | darkorchid

darkred

The color darkred | darkred

darksalmon

The color darksalmon | darksalmon

darkseagreen

The color darkseagreen | darkseagreen

darkslateblue

The color darkslateblue | darkslateblue

darkslategray

The color darkslategray | darkslategray

darkturquoise

The color darkturquoise | darkturquoise

darkviolet

The color darkviolet | darkviolet

deeppink

The color deeppink | deeppink

deepskyblue

The color deepskyblue | deepskyblue

dimgray

The color dimgray | dimgray

dimgrey

The color dimgrey | dimgrey

dodgerblue

The color dodgerblue | dodgerblue

firebrick

The color firebrick | firebrick

floralwhite

The color floralwhite | floralwhite

forestgreen

The color forestgreen | forestgreen

fuchsia

The color fuchsia | fuchsia

gainsboro

The color gainsboro | gainsboro

ghostwhite

The color ghostwhite | ghostwhite

gold

The color gold | gold

goldenrod

The color goldenrod | goldenrod

gray

The color gray | gray

green

The color green | green

greenyellow

The color greenyellow | greenyellow

grey

The color grey | grey

honeydew

The color honeydew | honeydew

hotpink

The color hotpink | hotpink

indianred

The color indianred | indianred

indigo

The color indigo | indigo

ivory

The color ivory | ivory

khaki

The color khaki | khaki

lavender

The color lavender | lavender

lavenderblush

The color lavenderblush | lavenderblush

lawngreen

The color lawngreen | lawngreen

lemonchiffon

The color lemonchiffon | lemonchiffon

lightblue

The color lightblue | lightblue

lightcoral

The color lightcoral | lightcoral

lightcyan

The color lightcyan | lightcyan

lightgoldenrodyellow

The color lightgoldenrodyellow | lightgoldenrodyellow

lightgray

The color lightgray | lightgray

lightgreen

The color lightgreen | lightgreen

lightgrey

The color lightgrey | lightgrey

lightpink

The color lightpink | lightpink

lightsalmon

The color lightsalmon | lightsalmon

lightseagreen

The color lightseagreen | lightseagreen

lightskyblue

The color lightskyblue | lightskyblue

lightslategray

The color lightslategray | lightslategray

lightsteelblue

The color lightsteelblue | lightsteelblue

lightyellow

The color lightyellow | lightyellow

lime

The color lime | lime

limegreen

The color limegreen | limegreen

linen

The color linen | linen

magenta

The color magenta | magenta

maroon

The color maroon | maroon

mediumaquamarine

The color mediumaquamarine | mediumaquamarine

mediumblue

The color mediumblue | mediumblue

mediumorchid

The color mediumorchid | mediumorchid

mediumpurple

The color mediumpurple | mediumpurple

mediumseagreen

The color mediumseagreen | mediumseagreen

mediumslateblue

The color mediumslateblue | mediumslateblue

mediumspringgreen

The color mediumspringgreen | mediumspringgreen

mediumturquoise

The color mediumturquoise | mediumturquoise

mediumvioletred

The color mediumvioletred | mediumvioletred

midnightblue

The color midnightblue | midnightblue

mintcream

The color mintcream | mintcream

mistyrose

The color mistyrose | mistyrose

moccasin

The color moccasin | moccasin

navajowhite

The color navajowhite | navajowhite

navy

The color navy | navy

oldlace

The color oldlace | oldlace

olive

The color olive | olive

olivedrab

The color olivedrab | olivedrab

orange

The color orange | orange

orangered

The color orangered | orangered

orchid

The color orchid | orchid

palegoldenrod

The color palegoldenrod | palegoldenrod

palegreen

The color palegreen | palegreen

paleturquoise

The color paleturquoise | paleturquoise

palevioletred

The color palevioletred | palevioletred

papayawhip

The color papayawhip | papayawhip

peachpuff

The color peachpuff | peachpuff

peru

The color peru | peru

pink

The color pink | pink

plum

The color plum | plum

powderblue

The color powderblue | powderblue

purple

The color purple | purple

red

The color red | red

rosybrown

The color rosybrown | rosybrown

royalblue

The color royalblue | royalblue

saddlebrown

The color saddlebrown | saddlebrown

salmon

The color salmon | salmon

sandybrown

The color sandybrown | sandybrown

seagreen

The color seagreen | seagreen

seashell

The color seashell | seashell

sienna

The color sienna | sienna

silver

The color silver | silver

skyblue

The color skyblue | skyblue

slateblue

The color slateblue | slateblue

slategray

The color slategray | slategray

snow

The color snow | snow

springgreen

The color springgreen | springgreen

steelblue

The color steelblue | steelblue

tan

The color tan | tan

teal

The color teal | teal

thistle

The color thistle | thistle

tomato

The color tomato | tomato

turquoise

The color turquoise | turquoise

violet

The color violet | violet

wheat

The color wheat | wheat

white

The color white | white

whitesmoke

The color whitesmoke | whitesmoke

yellow

The color yellow | yellow

yellowgreen

The color yellowgreen | yellowgreen

Color dataclass

Color(red: int, green: int, blue: int, alpha: float = 1.0)

Bases: object

Class for colors

Parameters:

Name Type Description Default
red int

The red component of the color

required
green int

The green component of the color

required
blue int

The blue component of the color

required
alpha float

The alpha component of the color

1.0

Methods:

Name Description
from_hex

Return a color from its HEX value

from_hexa

Return a color from its HEXA value

from_rgb

Return a color from its RGB components

from_rgba

Return a color from its RGBA components

to_hex

Return the color in the HEX format

to_hexa

Return the color in the HEXA format

to_rgb

Return the color in the RBG format

to_rgba

Return the color in the RBGA format

with_alpha

Return the a copy of the color with its alpha component set to the given number

from_hex classmethod

from_hex(color_str: str)

Return a color from its HEX value

Source code in src/momapy/coloring.py
@classmethod
def from_hex(cls, color_str: str):
    """Return a color from its HEX value"""
    color_str = color_str.lstrip("#")
    if len(color_str) != 6:
        raise ValueError(f"invalid hexadecimal RBG value {color_str}")
    red = int(color_str[:2], 16)
    green = int(color_str[2:4], 16)
    blue = int(color_str[4:6], 16)
    return cls(red, green, blue)

from_hexa classmethod

from_hexa(color_str)

Return a color from its HEXA value

Source code in src/momapy/coloring.py
@classmethod
def from_hexa(cls, color_str):
    """Return a color from its HEXA value"""
    color_str = color_str.lstrip("#")
    if len(color_str) != 8:
        raise ValueError(f"invalid hexadecimal RBGA value {color_str}")
    red = int(color_str[:2], 16)
    green = int(color_str[2:4], 16)
    blue = int(color_str[4:6], 16)
    alpha = int(color_str[6:], 16) / 255
    return cls(red, green, blue, alpha)

from_rgb classmethod

from_rgb(red: int, green: int, blue: int)

Return a color from its RGB components

Source code in src/momapy/coloring.py
@classmethod
def from_rgb(cls, red: int, green: int, blue: int):
    """Return a color from its RGB components"""
    return cls(red, green, blue)

from_rgba classmethod

from_rgba(
    red: int, green: int, blue: int, alpha: float
) -> Self

Return a color from its RGBA components

Source code in src/momapy/coloring.py
@classmethod
def from_rgba(
    cls, red: int, green: int, blue: int, alpha: float
) -> typing.Self:
    """Return a color from its RGBA components"""
    return cls(red, green, blue, alpha)

to_hex

to_hex() -> str

Return the color in the HEX format

Source code in src/momapy/coloring.py
def to_hex(self) -> str:
    """Return the color in the HEX format"""
    color_str = f"#{format(self.red, '02x')}{format(self.green, '02x')}{format(self.blue, '02x')}"
    return color_str

to_hexa

to_hexa() -> str

Return the color in the HEXA format

Source code in src/momapy/coloring.py
def to_hexa(self) -> str:
    """Return the color in the HEXA format"""
    color_str = f"{self.to_hex()}{format(int(self.alpha * 255), '02x')}"
    return color_str

to_rgb

to_rgb(
    rgb_range: tuple[float, float] | tuple[int, int] = (
        0,
        255,
    ),
) -> tuple[int, int, int]

Return the color in the RBG format

Source code in src/momapy/coloring.py
def to_rgb(
    self, rgb_range: tuple[float, float] | tuple[int, int] = (0, 255)
) -> tuple[int, int, int]:
    """Return the color in the RBG format"""
    width = int(rgb_range[1] - rgb_range[0])
    red = rgb_range[0] + (self.red / 255) * width
    green = rgb_range[0] + (self.green / 255) * width
    blue = rgb_range[0] + (self.blue / 255) * width
    if isinstance(rgb_range[0], int):
        red = int(round(red))
        green = int(round(green))
        blue = int(round(blue))
    return (red, green, blue)

to_rgba

to_rgba(
    rgb_range: tuple[float, float] | tuple[int, int] = (
        0,
        255,
    ),
    alpha_range: tuple[float, float] = (0.0, 1.0),
    rgba_range: tuple[float, float] | None = None,
) -> tuple[int, int, int, float]

Return the color in the RBGA format

Source code in src/momapy/coloring.py
def to_rgba(
    self,
    rgb_range: tuple[float, float] | tuple[int, int] = (0, 255),
    alpha_range: tuple[float, float] = (0.0, 1.0),
    rgba_range: tuple[float, float] | None = None,
) -> tuple[int, int, int, float]:
    """Return the color in the RBGA format"""
    if rgba_range is not None:
        rgb_range = rgba_range
        alpha_range = rgba_range
    rgb_width = rgb_range[1] - rgb_range[0]
    alpha_width = alpha_range[1] - alpha_range[0]
    red = rgb_range[0] + (self.red / 255) * rgb_width
    green = rgb_range[0] + (self.green / 255) * rgb_width
    blue = rgb_range[0] + (self.blue / 255) * rgb_width
    alpha = alpha_range[0] + self.alpha * alpha_width
    if isinstance(rgb_range[0], int):
        red = int(round(red))
        green = int(round(green))
        blue = int(round(blue))
    return (red, green, blue, alpha)

with_alpha

with_alpha(
    alpha: float, alpha_range: tuple[float, float] = (0, 1)
) -> Self

Return the a copy of the color with its alpha component set to the given number

Source code in src/momapy/coloring.py
def with_alpha(
    self, alpha: float, alpha_range: tuple[float, float] = (0, 1)
) -> typing.Self:
    """Return the a copy of the color with its alpha component set to the given number"""
    alpha_width = alpha_range[1] - alpha_range[0]
    return dataclasses.replace(
        self, alpha=alpha_range[0] + alpha * alpha_width
    )

aliceblue module-attribute

aliceblue = from_rgb(240, 248, 255)

The color aliceblue | aliceblue

antiquewhite module-attribute

antiquewhite = from_rgb(250, 235, 215)

The color antiquewhite | antiquewhite

aqua module-attribute

aqua = from_rgb(0, 255, 255)

The color aqua | aqua

aquamarine module-attribute

aquamarine = from_rgb(127, 255, 212)

The color aquamarine | aquamarine

azure module-attribute

azure = from_rgb(240, 255, 255)

The color azure | azure

beige module-attribute

beige = from_rgb(245, 245, 220)

The color beige | beige

bisque module-attribute

bisque = from_rgb(255, 228, 196)

The color bisque | bisque

black module-attribute

black = from_rgb(0, 0, 0)

The color black | black

blanchedalmond module-attribute

blanchedalmond = from_rgb(255, 235, 205)

The color blanchedalmond | blanchedalmond

blue module-attribute

blue = from_rgb(0, 0, 255)

The color blue | blue

blueviolet module-attribute

blueviolet = from_rgb(138, 43, 226)

The color blueviolet | blueviolet

brown module-attribute

brown = from_rgb(165, 42, 42)

The color brown | brown

burlywood module-attribute

burlywood = from_rgb(222, 184, 135)

The color burlywood | burlywood

cadetblue module-attribute

cadetblue = from_rgb(95, 158, 160)

The color cadetblue | cadetblue

chartreuse module-attribute

chartreuse = from_rgb(127, 255, 0)

The color chartreuse | chartreuse

chocolate module-attribute

chocolate = from_rgb(210, 105, 30)

The color chocolate | chocolate

coral module-attribute

coral = from_rgb(255, 127, 80)

The color coral | coral

cornflowerblue module-attribute

cornflowerblue = from_rgb(100, 149, 237)

The color cornflowerblue | cornflowerblue

cornsilk module-attribute

cornsilk = from_rgb(255, 248, 220)

The color cornsilk | cornsilk

crimson module-attribute

crimson = from_rgb(220, 20, 60)

The color crimson | crimson

cyan module-attribute

cyan = from_rgb(0, 255, 255)

The color cyan | cyan

darkblue module-attribute

darkblue = from_rgb(0, 0, 139)

The color darkblue | darkblue

darkcyan module-attribute

darkcyan = from_rgb(0, 139, 139)

The color darkcyan | darkcyan

darkgoldenrod module-attribute

darkgoldenrod = from_rgb(184, 134, 11)

The color darkgoldenrod | darkgoldenrod

darkgray module-attribute

darkgray = from_rgb(169, 169, 169)

The color darkgray | darkgray

darkgreen module-attribute

darkgreen = from_rgb(0, 100, 0)

The color darkgreen | darkgreen

darkgrey module-attribute

darkgrey = from_rgb(169, 169, 169)

The color darkgrey | darkgrey

darkkhaki module-attribute

darkkhaki = from_rgb(189, 183, 107)

The color darkkhaki | darkkhaki

darkmagenta module-attribute

darkmagenta = from_rgb(139, 0, 139)

The color darkmagenta | darkmagenta

darkolivegreen module-attribute

darkolivegreen = from_rgb(85, 107, 47)

The color darkolivegreen | darkolivegreen

darkorange module-attribute

darkorange = from_rgb(255, 140, 0)

The color darkorange | darkorange

darkorchid module-attribute

darkorchid = from_rgb(153, 50, 204)

The color darkorchid | darkorchid

darkred module-attribute

darkred = from_rgb(139, 0, 0)

The color darkred | darkred

darksalmon module-attribute

darksalmon = from_rgb(233, 150, 122)

The color darksalmon | darksalmon

darkseagreen module-attribute

darkseagreen = from_rgb(143, 188, 143)

The color darkseagreen | darkseagreen

darkslateblue module-attribute

darkslateblue = from_rgb(72, 61, 139)

The color darkslateblue | darkslateblue

darkslategray module-attribute

darkslategray = from_rgb(47, 79, 79)

The color darkslategray | darkslategray

darkturquoise module-attribute

darkturquoise = from_rgb(0, 206, 209)

The color darkturquoise | darkturquoise

darkviolet module-attribute

darkviolet = from_rgb(148, 0, 211)

The color darkviolet | darkviolet

deeppink module-attribute

deeppink = from_rgb(255, 20, 147)

The color deeppink | deeppink

deepskyblue module-attribute

deepskyblue = from_rgb(0, 191, 255)

The color deepskyblue | deepskyblue

dimgray module-attribute

dimgray = from_rgb(105, 105, 105)

The color dimgray | dimgray

dimgrey module-attribute

dimgrey = from_rgb(105, 105, 105)

The color dimgrey | dimgrey

dodgerblue module-attribute

dodgerblue = from_rgb(30, 144, 255)

The color dodgerblue | dodgerblue

firebrick module-attribute

firebrick = from_rgb(178, 34, 34)

The color firebrick | firebrick

floralwhite module-attribute

floralwhite = from_rgb(255, 250, 240)

The color floralwhite | floralwhite

forestgreen module-attribute

forestgreen = from_rgb(34, 139, 34)

The color forestgreen | forestgreen

fuchsia module-attribute

fuchsia = from_rgb(255, 0, 255)

The color fuchsia | fuchsia

gainsboro module-attribute

gainsboro = from_rgb(220, 220, 220)

The color gainsboro | gainsboro

ghostwhite module-attribute

ghostwhite = from_rgb(248, 248, 255)

The color ghostwhite | ghostwhite

gold module-attribute

gold = from_rgb(255, 215, 0)

The color gold | gold

goldenrod module-attribute

goldenrod = from_rgb(218, 165, 32)

The color goldenrod | goldenrod

gray module-attribute

gray = from_rgb(128, 128, 128)

The color gray | gray

green module-attribute

green = from_rgb(0, 128, 0)

The color green | green

greenyellow module-attribute

greenyellow = from_rgb(173, 255, 47)

The color greenyellow | greenyellow

grey module-attribute

grey = from_rgb(128, 128, 128)

The color grey | grey

has_color

has_color(color_name)

Return true if a color with the given name is available, false otherwise

Source code in src/momapy/coloring.py
def has_color(color_name):
    """Return `true` if a color with the given name is available, `false` otherwise"""
    for color_name2, color in globals().items():
        if isinstance(color, Color) and color_name2 == color_name:
            return True
    return False

honeydew module-attribute

honeydew = from_rgb(240, 255, 240)

The color honeydew | honeydew

hotpink module-attribute

hotpink = from_rgb(255, 105, 180)

The color hotpink | hotpink

indianred module-attribute

indianred = from_rgb(205, 92, 92)

The color indianred | indianred

indigo module-attribute

indigo = from_rgb(75, 0, 130)

The color indigo | indigo

ivory module-attribute

ivory = from_rgb(255, 255, 240)

The color ivory | ivory

khaki module-attribute

khaki = from_rgb(240, 230, 140)

The color khaki | khaki

lavender module-attribute

lavender = from_rgb(230, 230, 250)

The color lavender | lavender

lavenderblush module-attribute

lavenderblush = from_rgb(255, 240, 245)

The color lavenderblush | lavenderblush

lawngreen module-attribute

lawngreen = from_rgb(124, 252, 0)

The color lawngreen | lawngreen

lemonchiffon module-attribute

lemonchiffon = from_rgb(255, 250, 205)

The color lemonchiffon | lemonchiffon

lightblue module-attribute

lightblue = from_rgb(173, 216, 230)

The color lightblue | lightblue

lightcoral module-attribute

lightcoral = from_rgb(240, 128, 128)

The color lightcoral | lightcoral

lightcyan module-attribute

lightcyan = from_rgb(224, 255, 255)

The color lightcyan | lightcyan

lightgoldenrodyellow module-attribute

lightgoldenrodyellow = from_rgb(250, 250, 210)

The color lightgoldenrodyellow | lightgoldenrodyellow

lightgray module-attribute

lightgray = from_rgb(211, 211, 211)

The color lightgray | lightgray

lightgreen module-attribute

lightgreen = from_rgb(144, 238, 144)

The color lightgreen | lightgreen

lightgrey module-attribute

lightgrey = from_rgb(211, 211, 211)

The color lightgrey | lightgrey

lightpink module-attribute

lightpink = from_rgb(255, 182, 193)

The color lightpink | lightpink

lightsalmon module-attribute

lightsalmon = from_rgb(255, 160, 122)

The color lightsalmon | lightsalmon

lightseagreen module-attribute

lightseagreen = from_rgb(32, 178, 170)

The color lightseagreen | lightseagreen

lightskyblue module-attribute

lightskyblue = from_rgb(135, 206, 250)

The color lightskyblue | lightskyblue

lightslategray module-attribute

lightslategray = from_rgb(119, 136, 153)

The color lightslategray | lightslategray

lightsteelblue module-attribute

lightsteelblue = from_rgb(176, 196, 222)

The color lightsteelblue | lightsteelblue

lightyellow module-attribute

lightyellow = from_rgb(255, 255, 224)

The color lightyellow | lightyellow

lime module-attribute

lime = from_rgb(0, 255, 0)

The color lime | lime

limegreen module-attribute

limegreen = from_rgb(50, 205, 50)

The color limegreen | limegreen

linen module-attribute

linen = from_rgb(250, 240, 230)

The color linen | linen

list_colors

list_colors()

List all available named colors

Source code in src/momapy/coloring.py
def list_colors():
    """List all available named colors"""
    return [
        (color_name, color)
        for color_name, color in globals().items()
        if isinstance(color, Color)
    ]

magenta module-attribute

magenta = from_rgb(255, 0, 255)

The color magenta | magenta

maroon module-attribute

maroon = from_rgb(128, 0, 0)

The color maroon | maroon

mediumaquamarine module-attribute

mediumaquamarine = from_rgb(102, 205, 170)

The color mediumaquamarine | mediumaquamarine

mediumblue module-attribute

mediumblue = from_rgb(0, 0, 205)

The color mediumblue | mediumblue

mediumorchid module-attribute

mediumorchid = from_rgb(186, 85, 211)

The color mediumorchid | mediumorchid

mediumpurple module-attribute

mediumpurple = from_rgb(147, 112, 219)

The color mediumpurple | mediumpurple

mediumseagreen module-attribute

mediumseagreen = from_rgb(60, 179, 113)

The color mediumseagreen | mediumseagreen

mediumslateblue module-attribute

mediumslateblue = from_rgb(123, 104, 238)

The color mediumslateblue | mediumslateblue

mediumspringgreen module-attribute

mediumspringgreen = from_rgb(0, 250, 154)

The color mediumspringgreen | mediumspringgreen

mediumturquoise module-attribute

mediumturquoise = from_rgb(72, 209, 204)

The color mediumturquoise | mediumturquoise

mediumvioletred module-attribute

mediumvioletred = from_rgb(199, 21, 133)

The color mediumvioletred | mediumvioletred

midnightblue module-attribute

midnightblue = from_rgb(25, 25, 112)

The color midnightblue | midnightblue

mintcream module-attribute

mintcream = from_rgb(245, 255, 250)

The color mintcream | mintcream

mistyrose module-attribute

mistyrose = from_rgb(255, 228, 225)

The color mistyrose | mistyrose

moccasin module-attribute

moccasin = from_rgb(255, 228, 181)

The color moccasin | moccasin

navajowhite module-attribute

navajowhite = from_rgb(255, 222, 173)

The color navajowhite | navajowhite

navy module-attribute

navy = from_rgb(0, 0, 128)

The color navy | navy

oldlace module-attribute

oldlace = from_rgb(253, 245, 230)

The color oldlace | oldlace

olive module-attribute

olive = from_rgb(128, 128, 0)

The color olive | olive

olivedrab module-attribute

olivedrab = from_rgb(107, 142, 35)

The color olivedrab | olivedrab

orange module-attribute

orange = from_rgb(255, 165, 0)

The color orange | orange

orangered module-attribute

orangered = from_rgb(255, 69, 0)

The color orangered | orangered

orchid module-attribute

orchid = from_rgb(218, 112, 214)

The color orchid | orchid

palegoldenrod module-attribute

palegoldenrod = from_rgb(238, 232, 170)

The color palegoldenrod | palegoldenrod

palegreen module-attribute

palegreen = from_rgb(152, 251, 152)

The color palegreen | palegreen

paleturquoise module-attribute

paleturquoise = from_rgb(175, 238, 238)

The color paleturquoise | paleturquoise

palevioletred module-attribute

palevioletred = from_rgb(219, 112, 147)

The color palevioletred | palevioletred

papayawhip module-attribute

papayawhip = from_rgb(255, 239, 213)

The color papayawhip | papayawhip

peachpuff module-attribute

peachpuff = from_rgb(255, 218, 185)

The color peachpuff | peachpuff

peru module-attribute

peru = from_rgb(205, 133, 63)

The color peru | peru

pink module-attribute

pink = from_rgb(255, 192, 203)

The color pink | pink

plum module-attribute

plum = from_rgb(221, 160, 221)

The color plum | plum

powderblue module-attribute

powderblue = from_rgb(176, 224, 230)

The color powderblue | powderblue

print_colors

print_colors()

Print all available named colors

Source code in src/momapy/coloring.py
def print_colors():
    """Print all available named colors"""
    for color_name, color in list_colors():
        print(f"\x1b[38;2;{color.red};{color.green};{color.blue}m{color_name}")

purple module-attribute

purple = from_rgb(128, 0, 128)

The color purple | purple

red module-attribute

red = from_rgb(255, 0, 0)

The color red | red

rosybrown module-attribute

rosybrown = from_rgb(188, 143, 143)

The color rosybrown | rosybrown

royalblue module-attribute

royalblue = from_rgb(65, 105, 225)

The color royalblue | royalblue

saddlebrown module-attribute

saddlebrown = from_rgb(139, 69, 19)

The color saddlebrown | saddlebrown

salmon module-attribute

salmon = from_rgb(250, 128, 114)

The color salmon | salmon

sandybrown module-attribute

sandybrown = from_rgb(244, 164, 96)

The color sandybrown | sandybrown

seagreen module-attribute

seagreen = from_rgb(46, 139, 87)

The color seagreen | seagreen

seashell module-attribute

seashell = from_rgb(255, 245, 238)

The color seashell | seashell

sienna module-attribute

sienna = from_rgb(160, 82, 45)

The color sienna | sienna

silver module-attribute

silver = from_rgb(192, 192, 192)

The color silver | silver

skyblue module-attribute

skyblue = from_rgb(135, 206, 235)

The color skyblue | skyblue

slateblue module-attribute

slateblue = from_rgb(106, 90, 205)

The color slateblue | slateblue

slategray module-attribute

slategray = from_rgb(112, 128, 144)

The color slategray | slategray

snow module-attribute

snow = from_rgb(255, 250, 250)

The color snow | snow

springgreen module-attribute

springgreen = from_rgb(0, 255, 127)

The color springgreen | springgreen

steelblue module-attribute

steelblue = from_rgb(70, 130, 180)

The color steelblue | steelblue

tan module-attribute

tan = from_rgb(210, 180, 140)

The color tan | tan

teal module-attribute

teal = from_rgb(0, 128, 128)

The color teal | teal

thistle module-attribute

thistle = from_rgb(216, 191, 216)

The color thistle | thistle

tomato module-attribute

tomato = from_rgb(255, 99, 71)

The color tomato | tomato

turquoise module-attribute

turquoise = from_rgb(64, 224, 208)

The color turquoise | turquoise

violet module-attribute

violet = from_rgb(238, 130, 238)

The color violet | violet

wheat module-attribute

wheat = from_rgb(245, 222, 179)

The color wheat | wheat

white module-attribute

white = from_rgb(255, 255, 255)

The color white | white

whitesmoke module-attribute

whitesmoke = from_rgb(245, 245, 245)

The color whitesmoke | whitesmoke

yellow module-attribute

yellow = from_rgb(255, 255, 0)

The color yellow | yellow

yellowgreen module-attribute

yellowgreen = from_rgb(154, 205, 50)

The color yellowgreen | yellowgreen