Coloring
momapy.coloring
Classes and objects for defining colors
Classes:
Name | Description |
---|---|
Color |
Class for colors |
Functions:
Name | Description |
---|---|
has_color |
Return |
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
Bases: object
Class for colors
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
Return a color from its HEX value
Source code in src/momapy/coloring.py
from_hexa
classmethod
Return a color from its HEXA value
Source code in src/momapy/coloring.py
from_rgb
classmethod
from_rgba
classmethod
to_hex
to_hexa
to_rgb
Return the color in the RBG format
Source code in src/momapy/coloring.py
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
with_alpha
Return the a copy of the color with its alpha component set to the given number
Source code in src/momapy/coloring.py
antiquewhite
module-attribute
antiquewhite = from_rgb(250, 235, 215)
The color antiquewhite | antiquewhite
blanchedalmond
module-attribute
blanchedalmond = from_rgb(255, 235, 205)
The color blanchedalmond | blanchedalmond
cornflowerblue
module-attribute
cornflowerblue = from_rgb(100, 149, 237)
The color cornflowerblue | cornflowerblue
darkgoldenrod
module-attribute
darkgoldenrod = from_rgb(184, 134, 11)
The color darkgoldenrod | darkgoldenrod
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
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
deepskyblue
module-attribute
deepskyblue = from_rgb(0, 191, 255)
The color deepskyblue | deepskyblue
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
greenyellow
module-attribute
greenyellow = from_rgb(173, 255, 47)
The color greenyellow | greenyellow
has_color
Return true
if a color with the given name is available, false
otherwise
lavenderblush
module-attribute
lavenderblush = from_rgb(255, 240, 245)
The color lavenderblush | lavenderblush
lemonchiffon
module-attribute
lemonchiffon = from_rgb(255, 250, 205)
The color lemonchiffon | lemonchiffon
lightgoldenrodyellow
module-attribute
lightgoldenrodyellow = from_rgb(250, 250, 210)
The color lightgoldenrodyellow | lightgoldenrodyellow
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
list_colors
mediumaquamarine
module-attribute
mediumaquamarine = from_rgb(102, 205, 170)
The color mediumaquamarine | mediumaquamarine
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
navajowhite
module-attribute
navajowhite = from_rgb(255, 222, 173)
The color navajowhite | navajowhite
palegoldenrod
module-attribute
palegoldenrod = from_rgb(238, 232, 170)
The color palegoldenrod | palegoldenrod
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
print_colors
saddlebrown
module-attribute
saddlebrown = from_rgb(139, 69, 19)
The color saddlebrown | saddlebrown
springgreen
module-attribute
springgreen = from_rgb(0, 255, 127)
The color springgreen | springgreen
yellowgreen
module-attribute
yellowgreen = from_rgb(154, 205, 50)
The color yellowgreen | yellowgreen