Best Python code snippet using green
_color_data.py
Source:_color_data.py
1from collections import OrderedDict2BASE_COLORS = {3 'b': (0, 0, 1),4 'g': (0, 0.5, 0),5 'r': (1, 0, 0),6 'c': (0, 0.75, 0.75),7 'm': (0.75, 0, 0.75),8 'y': (0.75, 0.75, 0),9 'k': (0, 0, 0),10 'w': (1, 1, 1)}11# These colors are from Tableau12TABLEAU_COLORS = (13 ('blue', '#1f77b4'),14 ('orange', '#ff7f0e'),15 ('green', '#2ca02c'),16 ('red', '#d62728'),17 ('purple', '#9467bd'),18 ('brown', '#8c564b'),19 ('pink', '#e377c2'),20 ('gray', '#7f7f7f'),21 ('olive', '#bcbd22'),22 ('cyan', '#17becf'),23)24# Normalize name to "tab:<name>" to avoid name collisions.25TABLEAU_COLORS = OrderedDict(26 ('tab:' + name, value) for name, value in TABLEAU_COLORS)27# This mapping of color names -> hex values is taken from28# a survey run by Randall Munroe see:29# http://blog.xkcd.com/2010/05/03/color-survey-results/30# for more details. The results are hosted at31# https://xkcd.com/color/rgb.txt32#33# License: http://creativecommons.org/publicdomain/zero/1.0/34XKCD_COLORS = {35 'cloudy blue': '#acc2d9',36 'dark pastel green': '#56ae57',37 'dust': '#b2996e',38 'electric lime': '#a8ff04',39 'fresh green': '#69d84f',40 'light eggplant': '#894585',41 'nasty green': '#70b23f',42 'really light blue': '#d4ffff',43 'tea': '#65ab7c',44 'warm purple': '#952e8f',45 'yellowish tan': '#fcfc81',46 'cement': '#a5a391',47 'dark grass green': '#388004',48 'dusty teal': '#4c9085',49 'grey teal': '#5e9b8a',50 'macaroni and cheese': '#efb435',51 'pinkish tan': '#d99b82',52 'spruce': '#0a5f38',53 'strong blue': '#0c06f7',54 'toxic green': '#61de2a',55 'windows blue': '#3778bf',56 'blue blue': '#2242c7',57 'blue with a hint of purple': '#533cc6',58 'booger': '#9bb53c',59 'bright sea green': '#05ffa6',60 'dark green blue': '#1f6357',61 'deep turquoise': '#017374',62 'green teal': '#0cb577',63 'strong pink': '#ff0789',64 'bland': '#afa88b',65 'deep aqua': '#08787f',66 'lavender pink': '#dd85d7',67 'light moss green': '#a6c875',68 'light seafoam green': '#a7ffb5',69 'olive yellow': '#c2b709',70 'pig pink': '#e78ea5',71 'deep lilac': '#966ebd',72 'desert': '#ccad60',73 'dusty lavender': '#ac86a8',74 'purpley grey': '#947e94',75 'purply': '#983fb2',76 'candy pink': '#ff63e9',77 'light pastel green': '#b2fba5',78 'boring green': '#63b365',79 'kiwi green': '#8ee53f',80 'light grey green': '#b7e1a1',81 'orange pink': '#ff6f52',82 'tea green': '#bdf8a3',83 'very light brown': '#d3b683',84 'egg shell': '#fffcc4',85 'eggplant purple': '#430541',86 'powder pink': '#ffb2d0',87 'reddish grey': '#997570',88 'baby shit brown': '#ad900d',89 'liliac': '#c48efd',90 'stormy blue': '#507b9c',91 'ugly brown': '#7d7103',92 'custard': '#fffd78',93 'darkish pink': '#da467d',94 'deep brown': '#410200',95 'greenish beige': '#c9d179',96 'manilla': '#fffa86',97 'off blue': '#5684ae',98 'battleship grey': '#6b7c85',99 'browny green': '#6f6c0a',100 'bruise': '#7e4071',101 'kelley green': '#009337',102 'sickly yellow': '#d0e429',103 'sunny yellow': '#fff917',104 'azul': '#1d5dec',105 'darkgreen': '#054907',106 'green/yellow': '#b5ce08',107 'lichen': '#8fb67b',108 'light light green': '#c8ffb0',109 'pale gold': '#fdde6c',110 'sun yellow': '#ffdf22',111 'tan green': '#a9be70',112 'burple': '#6832e3',113 'butterscotch': '#fdb147',114 'toupe': '#c7ac7d',115 'dark cream': '#fff39a',116 'indian red': '#850e04',117 'light lavendar': '#efc0fe',118 'poison green': '#40fd14',119 'baby puke green': '#b6c406',120 'bright yellow green': '#9dff00',121 'charcoal grey': '#3c4142',122 'squash': '#f2ab15',123 'cinnamon': '#ac4f06',124 'light pea green': '#c4fe82',125 'radioactive green': '#2cfa1f',126 'raw sienna': '#9a6200',127 'baby purple': '#ca9bf7',128 'cocoa': '#875f42',129 'light royal blue': '#3a2efe',130 'orangeish': '#fd8d49',131 'rust brown': '#8b3103',132 'sand brown': '#cba560',133 'swamp': '#698339',134 'tealish green': '#0cdc73',135 'burnt siena': '#b75203',136 'camo': '#7f8f4e',137 'dusk blue': '#26538d',138 'fern': '#63a950',139 'old rose': '#c87f89',140 'pale light green': '#b1fc99',141 'peachy pink': '#ff9a8a',142 'rosy pink': '#f6688e',143 'light bluish green': '#76fda8',144 'light bright green': '#53fe5c',145 'light neon green': '#4efd54',146 'light seafoam': '#a0febf',147 'tiffany blue': '#7bf2da',148 'washed out green': '#bcf5a6',149 'browny orange': '#ca6b02',150 'nice blue': '#107ab0',151 'sapphire': '#2138ab',152 'greyish teal': '#719f91',153 'orangey yellow': '#fdb915',154 'parchment': '#fefcaf',155 'straw': '#fcf679',156 'very dark brown': '#1d0200',157 'terracota': '#cb6843',158 'ugly blue': '#31668a',159 'clear blue': '#247afd',160 'creme': '#ffffb6',161 'foam green': '#90fda9',162 'grey/green': '#86a17d',163 'light gold': '#fddc5c',164 'seafoam blue': '#78d1b6',165 'topaz': '#13bbaf',166 'violet pink': '#fb5ffc',167 'wintergreen': '#20f986',168 'yellow tan': '#ffe36e',169 'dark fuchsia': '#9d0759',170 'indigo blue': '#3a18b1',171 'light yellowish green': '#c2ff89',172 'pale magenta': '#d767ad',173 'rich purple': '#720058',174 'sunflower yellow': '#ffda03',175 'green/blue': '#01c08d',176 'leather': '#ac7434',177 'racing green': '#014600',178 'vivid purple': '#9900fa',179 'dark royal blue': '#02066f',180 'hazel': '#8e7618',181 'muted pink': '#d1768f',182 'booger green': '#96b403',183 'canary': '#fdff63',184 'cool grey': '#95a3a6',185 'dark taupe': '#7f684e',186 'darkish purple': '#751973',187 'true green': '#089404',188 'coral pink': '#ff6163',189 'dark sage': '#598556',190 'dark slate blue': '#214761',191 'flat blue': '#3c73a8',192 'mushroom': '#ba9e88',193 'rich blue': '#021bf9',194 'dirty purple': '#734a65',195 'greenblue': '#23c48b',196 'icky green': '#8fae22',197 'light khaki': '#e6f2a2',198 'warm blue': '#4b57db',199 'dark hot pink': '#d90166',200 'deep sea blue': '#015482',201 'carmine': '#9d0216',202 'dark yellow green': '#728f02',203 'pale peach': '#ffe5ad',204 'plum purple': '#4e0550',205 'golden rod': '#f9bc08',206 'neon red': '#ff073a',207 'old pink': '#c77986',208 'very pale blue': '#d6fffe',209 'blood orange': '#fe4b03',210 'grapefruit': '#fd5956',211 'sand yellow': '#fce166',212 'clay brown': '#b2713d',213 'dark blue grey': '#1f3b4d',214 'flat green': '#699d4c',215 'light green blue': '#56fca2',216 'warm pink': '#fb5581',217 'dodger blue': '#3e82fc',218 'gross green': '#a0bf16',219 'ice': '#d6fffa',220 'metallic blue': '#4f738e',221 'pale salmon': '#ffb19a',222 'sap green': '#5c8b15',223 'algae': '#54ac68',224 'bluey grey': '#89a0b0',225 'greeny grey': '#7ea07a',226 'highlighter green': '#1bfc06',227 'light light blue': '#cafffb',228 'light mint': '#b6ffbb',229 'raw umber': '#a75e09',230 'vivid blue': '#152eff',231 'deep lavender': '#8d5eb7',232 'dull teal': '#5f9e8f',233 'light greenish blue': '#63f7b4',234 'mud green': '#606602',235 'pinky': '#fc86aa',236 'red wine': '#8c0034',237 'shit green': '#758000',238 'tan brown': '#ab7e4c',239 'darkblue': '#030764',240 'rosa': '#fe86a4',241 'lipstick': '#d5174e',242 'pale mauve': '#fed0fc',243 'claret': '#680018',244 'dandelion': '#fedf08',245 'orangered': '#fe420f',246 'poop green': '#6f7c00',247 'ruby': '#ca0147',248 'dark': '#1b2431',249 'greenish turquoise': '#00fbb0',250 'pastel red': '#db5856',251 'piss yellow': '#ddd618',252 'bright cyan': '#41fdfe',253 'dark coral': '#cf524e',254 'algae green': '#21c36f',255 'darkish red': '#a90308',256 'reddy brown': '#6e1005',257 'blush pink': '#fe828c',258 'camouflage green': '#4b6113',259 'lawn green': '#4da409',260 'putty': '#beae8a',261 'vibrant blue': '#0339f8',262 'dark sand': '#a88f59',263 'purple/blue': '#5d21d0',264 'saffron': '#feb209',265 'twilight': '#4e518b',266 'warm brown': '#964e02',267 'bluegrey': '#85a3b2',268 'bubble gum pink': '#ff69af',269 'duck egg blue': '#c3fbf4',270 'greenish cyan': '#2afeb7',271 'petrol': '#005f6a',272 'royal': '#0c1793',273 'butter': '#ffff81',274 'dusty orange': '#f0833a',275 'off yellow': '#f1f33f',276 'pale olive green': '#b1d27b',277 'orangish': '#fc824a',278 'leaf': '#71aa34',279 'light blue grey': '#b7c9e2',280 'dried blood': '#4b0101',281 'lightish purple': '#a552e6',282 'rusty red': '#af2f0d',283 'lavender blue': '#8b88f8',284 'light grass green': '#9af764',285 'light mint green': '#a6fbb2',286 'sunflower': '#ffc512',287 'velvet': '#750851',288 'brick orange': '#c14a09',289 'lightish red': '#fe2f4a',290 'pure blue': '#0203e2',291 'twilight blue': '#0a437a',292 'violet red': '#a50055',293 'yellowy brown': '#ae8b0c',294 'carnation': '#fd798f',295 'muddy yellow': '#bfac05',296 'dark seafoam green': '#3eaf76',297 'deep rose': '#c74767',298 'dusty red': '#b9484e',299 'grey/blue': '#647d8e',300 'lemon lime': '#bffe28',301 'purple/pink': '#d725de',302 'brown yellow': '#b29705',303 'purple brown': '#673a3f',304 'wisteria': '#a87dc2',305 'banana yellow': '#fafe4b',306 'lipstick red': '#c0022f',307 'water blue': '#0e87cc',308 'brown grey': '#8d8468',309 'vibrant purple': '#ad03de',310 'baby green': '#8cff9e',311 'barf green': '#94ac02',312 'eggshell blue': '#c4fff7',313 'sandy yellow': '#fdee73',314 'cool green': '#33b864',315 'pale': '#fff9d0',316 'blue/grey': '#758da3',317 'hot magenta': '#f504c9',318 'greyblue': '#77a1b5',319 'purpley': '#8756e4',320 'baby shit green': '#889717',321 'brownish pink': '#c27e79',322 'dark aquamarine': '#017371',323 'diarrhea': '#9f8303',324 'light mustard': '#f7d560',325 'pale sky blue': '#bdf6fe',326 'turtle green': '#75b84f',327 'bright olive': '#9cbb04',328 'dark grey blue': '#29465b',329 'greeny brown': '#696006',330 'lemon green': '#adf802',331 'light periwinkle': '#c1c6fc',332 'seaweed green': '#35ad6b',333 'sunshine yellow': '#fffd37',334 'ugly purple': '#a442a0',335 'medium pink': '#f36196',336 'puke brown': '#947706',337 'very light pink': '#fff4f2',338 'viridian': '#1e9167',339 'bile': '#b5c306',340 'faded yellow': '#feff7f',341 'very pale green': '#cffdbc',342 'vibrant green': '#0add08',343 'bright lime': '#87fd05',344 'spearmint': '#1ef876',345 'light aquamarine': '#7bfdc7',346 'light sage': '#bcecac',347 'yellowgreen': '#bbf90f',348 'baby poo': '#ab9004',349 'dark seafoam': '#1fb57a',350 'deep teal': '#00555a',351 'heather': '#a484ac',352 'rust orange': '#c45508',353 'dirty blue': '#3f829d',354 'fern green': '#548d44',355 'bright lilac': '#c95efb',356 'weird green': '#3ae57f',357 'peacock blue': '#016795',358 'avocado green': '#87a922',359 'faded orange': '#f0944d',360 'grape purple': '#5d1451',361 'hot green': '#25ff29',362 'lime yellow': '#d0fe1d',363 'mango': '#ffa62b',364 'shamrock': '#01b44c',365 'bubblegum': '#ff6cb5',366 'purplish brown': '#6b4247',367 'vomit yellow': '#c7c10c',368 'pale cyan': '#b7fffa',369 'key lime': '#aeff6e',370 'tomato red': '#ec2d01',371 'lightgreen': '#76ff7b',372 'merlot': '#730039',373 'night blue': '#040348',374 'purpleish pink': '#df4ec8',375 'apple': '#6ecb3c',376 'baby poop green': '#8f9805',377 'green apple': '#5edc1f',378 'heliotrope': '#d94ff5',379 'yellow/green': '#c8fd3d',380 'almost black': '#070d0d',381 'cool blue': '#4984b8',382 'leafy green': '#51b73b',383 'mustard brown': '#ac7e04',384 'dusk': '#4e5481',385 'dull brown': '#876e4b',386 'frog green': '#58bc08',387 'vivid green': '#2fef10',388 'bright light green': '#2dfe54',389 'fluro green': '#0aff02',390 'kiwi': '#9cef43',391 'seaweed': '#18d17b',392 'navy green': '#35530a',393 'ultramarine blue': '#1805db',394 'iris': '#6258c4',395 'pastel orange': '#ff964f',396 'yellowish orange': '#ffab0f',397 'perrywinkle': '#8f8ce7',398 'tealish': '#24bca8',399 'dark plum': '#3f012c',400 'pear': '#cbf85f',401 'pinkish orange': '#ff724c',402 'midnight purple': '#280137',403 'light urple': '#b36ff6',404 'dark mint': '#48c072',405 'greenish tan': '#bccb7a',406 'light burgundy': '#a8415b',407 'turquoise blue': '#06b1c4',408 'ugly pink': '#cd7584',409 'sandy': '#f1da7a',410 'electric pink': '#ff0490',411 'muted purple': '#805b87',412 'mid green': '#50a747',413 'greyish': '#a8a495',414 'neon yellow': '#cfff04',415 'banana': '#ffff7e',416 'carnation pink': '#ff7fa7',417 'tomato': '#ef4026',418 'sea': '#3c9992',419 'muddy brown': '#886806',420 'turquoise green': '#04f489',421 'buff': '#fef69e',422 'fawn': '#cfaf7b',423 'muted blue': '#3b719f',424 'pale rose': '#fdc1c5',425 'dark mint green': '#20c073',426 'amethyst': '#9b5fc0',427 'blue/green': '#0f9b8e',428 'chestnut': '#742802',429 'sick green': '#9db92c',430 'pea': '#a4bf20',431 'rusty orange': '#cd5909',432 'stone': '#ada587',433 'rose red': '#be013c',434 'pale aqua': '#b8ffeb',435 'deep orange': '#dc4d01',436 'earth': '#a2653e',437 'mossy green': '#638b27',438 'grassy green': '#419c03',439 'pale lime green': '#b1ff65',440 'light grey blue': '#9dbcd4',441 'pale grey': '#fdfdfe',442 'asparagus': '#77ab56',443 'blueberry': '#464196',444 'purple red': '#990147',445 'pale lime': '#befd73',446 'greenish teal': '#32bf84',447 'caramel': '#af6f09',448 'deep magenta': '#a0025c',449 'light peach': '#ffd8b1',450 'milk chocolate': '#7f4e1e',451 'ocher': '#bf9b0c',452 'off green': '#6ba353',453 'purply pink': '#f075e6',454 'lightblue': '#7bc8f6',455 'dusky blue': '#475f94',456 'golden': '#f5bf03',457 'light beige': '#fffeb6',458 'butter yellow': '#fffd74',459 'dusky purple': '#895b7b',460 'french blue': '#436bad',461 'ugly yellow': '#d0c101',462 'greeny yellow': '#c6f808',463 'orangish red': '#f43605',464 'shamrock green': '#02c14d',465 'orangish brown': '#b25f03',466 'tree green': '#2a7e19',467 'deep violet': '#490648',468 'gunmetal': '#536267',469 'blue/purple': '#5a06ef',470 'cherry': '#cf0234',471 'sandy brown': '#c4a661',472 'warm grey': '#978a84',473 'dark indigo': '#1f0954',474 'midnight': '#03012d',475 'bluey green': '#2bb179',476 'grey pink': '#c3909b',477 'soft purple': '#a66fb5',478 'blood': '#770001',479 'brown red': '#922b05',480 'medium grey': '#7d7f7c',481 'berry': '#990f4b',482 'poo': '#8f7303',483 'purpley pink': '#c83cb9',484 'light salmon': '#fea993',485 'snot': '#acbb0d',486 'easter purple': '#c071fe',487 'light yellow green': '#ccfd7f',488 'dark navy blue': '#00022e',489 'drab': '#828344',490 'light rose': '#ffc5cb',491 'rouge': '#ab1239',492 'purplish red': '#b0054b',493 'slime green': '#99cc04',494 'baby poop': '#937c00',495 'irish green': '#019529',496 'pink/purple': '#ef1de7',497 'dark navy': '#000435',498 'greeny blue': '#42b395',499 'light plum': '#9d5783',500 'pinkish grey': '#c8aca9',501 'dirty orange': '#c87606',502 'rust red': '#aa2704',503 'pale lilac': '#e4cbff',504 'orangey red': '#fa4224',505 'primary blue': '#0804f9',506 'kermit green': '#5cb200',507 'brownish purple': '#76424e',508 'murky green': '#6c7a0e',509 'wheat': '#fbdd7e',510 'very dark purple': '#2a0134',511 'bottle green': '#044a05',512 'watermelon': '#fd4659',513 'deep sky blue': '#0d75f8',514 'fire engine red': '#fe0002',515 'yellow ochre': '#cb9d06',516 'pumpkin orange': '#fb7d07',517 'pale olive': '#b9cc81',518 'light lilac': '#edc8ff',519 'lightish green': '#61e160',520 'carolina blue': '#8ab8fe',521 'mulberry': '#920a4e',522 'shocking pink': '#fe02a2',523 'auburn': '#9a3001',524 'bright lime green': '#65fe08',525 'celadon': '#befdb7',526 'pinkish brown': '#b17261',527 'poo brown': '#885f01',528 'bright sky blue': '#02ccfe',529 'celery': '#c1fd95',530 'dirt brown': '#836539',531 'strawberry': '#fb2943',532 'dark lime': '#84b701',533 'copper': '#b66325',534 'medium brown': '#7f5112',535 'muted green': '#5fa052',536 "robin's egg": '#6dedfd',537 'bright aqua': '#0bf9ea',538 'bright lavender': '#c760ff',539 'ivory': '#ffffcb',540 'very light purple': '#f6cefc',541 'light navy': '#155084',542 'pink red': '#f5054f',543 'olive brown': '#645403',544 'poop brown': '#7a5901',545 'mustard green': '#a8b504',546 'ocean green': '#3d9973',547 'very dark blue': '#000133',548 'dusty green': '#76a973',549 'light navy blue': '#2e5a88',550 'minty green': '#0bf77d',551 'adobe': '#bd6c48',552 'barney': '#ac1db8',553 'jade green': '#2baf6a',554 'bright light blue': '#26f7fd',555 'light lime': '#aefd6c',556 'dark khaki': '#9b8f55',557 'orange yellow': '#ffad01',558 'ocre': '#c69c04',559 'maize': '#f4d054',560 'faded pink': '#de9dac',561 'british racing green': '#05480d',562 'sandstone': '#c9ae74',563 'mud brown': '#60460f',564 'light sea green': '#98f6b0',565 'robin egg blue': '#8af1fe',566 'aqua marine': '#2ee8bb',567 'dark sea green': '#11875d',568 'soft pink': '#fdb0c0',569 'orangey brown': '#b16002',570 'cherry red': '#f7022a',571 'burnt yellow': '#d5ab09',572 'brownish grey': '#86775f',573 'camel': '#c69f59',574 'purplish grey': '#7a687f',575 'marine': '#042e60',576 'greyish pink': '#c88d94',577 'pale turquoise': '#a5fbd5',578 'pastel yellow': '#fffe71',579 'bluey purple': '#6241c7',580 'canary yellow': '#fffe40',581 'faded red': '#d3494e',582 'sepia': '#985e2b',583 'coffee': '#a6814c',584 'bright magenta': '#ff08e8',585 'mocha': '#9d7651',586 'ecru': '#feffca',587 'purpleish': '#98568d',588 'cranberry': '#9e003a',589 'darkish green': '#287c37',590 'brown orange': '#b96902',591 'dusky rose': '#ba6873',592 'melon': '#ff7855',593 'sickly green': '#94b21c',594 'silver': '#c5c9c7',595 'purply blue': '#661aee',596 'purpleish blue': '#6140ef',597 'hospital green': '#9be5aa',598 'shit brown': '#7b5804',599 'mid blue': '#276ab3',600 'amber': '#feb308',601 'easter green': '#8cfd7e',602 'soft blue': '#6488ea',603 'cerulean blue': '#056eee',604 'golden brown': '#b27a01',605 'bright turquoise': '#0ffef9',606 'red pink': '#fa2a55',607 'red purple': '#820747',608 'greyish brown': '#7a6a4f',609 'vermillion': '#f4320c',610 'russet': '#a13905',611 'steel grey': '#6f828a',612 'lighter purple': '#a55af4',613 'bright violet': '#ad0afd',614 'prussian blue': '#004577',615 'slate green': '#658d6d',616 'dirty pink': '#ca7b80',617 'dark blue green': '#005249',618 'pine': '#2b5d34',619 'yellowy green': '#bff128',620 'dark gold': '#b59410',621 'bluish': '#2976bb',622 'darkish blue': '#014182',623 'dull red': '#bb3f3f',624 'pinky red': '#fc2647',625 'bronze': '#a87900',626 'pale teal': '#82cbb2',627 'military green': '#667c3e',628 'barbie pink': '#fe46a5',629 'bubblegum pink': '#fe83cc',630 'pea soup green': '#94a617',631 'dark mustard': '#a88905',632 'shit': '#7f5f00',633 'medium purple': '#9e43a2',634 'very dark green': '#062e03',635 'dirt': '#8a6e45',636 'dusky pink': '#cc7a8b',637 'red violet': '#9e0168',638 'lemon yellow': '#fdff38',639 'pistachio': '#c0fa8b',640 'dull yellow': '#eedc5b',641 'dark lime green': '#7ebd01',642 'denim blue': '#3b5b92',643 'teal blue': '#01889f',644 'lightish blue': '#3d7afd',645 'purpley blue': '#5f34e7',646 'light indigo': '#6d5acf',647 'swamp green': '#748500',648 'brown green': '#706c11',649 'dark maroon': '#3c0008',650 'hot purple': '#cb00f5',651 'dark forest green': '#002d04',652 'faded blue': '#658cbb',653 'drab green': '#749551',654 'light lime green': '#b9ff66',655 'snot green': '#9dc100',656 'yellowish': '#faee66',657 'light blue green': '#7efbb3',658 'bordeaux': '#7b002c',659 'light mauve': '#c292a1',660 'ocean': '#017b92',661 'marigold': '#fcc006',662 'muddy green': '#657432',663 'dull orange': '#d8863b',664 'steel': '#738595',665 'electric purple': '#aa23ff',666 'fluorescent green': '#08ff08',667 'yellowish brown': '#9b7a01',668 'blush': '#f29e8e',669 'soft green': '#6fc276',670 'bright orange': '#ff5b00',671 'lemon': '#fdff52',672 'purple grey': '#866f85',673 'acid green': '#8ffe09',674 'pale lavender': '#eecffe',675 'violet blue': '#510ac9',676 'light forest green': '#4f9153',677 'burnt red': '#9f2305',678 'khaki green': '#728639',679 'cerise': '#de0c62',680 'faded purple': '#916e99',681 'apricot': '#ffb16d',682 'dark olive green': '#3c4d03',683 'grey brown': '#7f7053',684 'green grey': '#77926f',685 'true blue': '#010fcc',686 'pale violet': '#ceaefa',687 'periwinkle blue': '#8f99fb',688 'light sky blue': '#c6fcff',689 'blurple': '#5539cc',690 'green brown': '#544e03',691 'bluegreen': '#017a79',692 'bright teal': '#01f9c6',693 'brownish yellow': '#c9b003',694 'pea soup': '#929901',695 'forest': '#0b5509',696 'barney purple': '#a00498',697 'ultramarine': '#2000b1',698 'purplish': '#94568c',699 'puke yellow': '#c2be0e',700 'bluish grey': '#748b97',701 'dark periwinkle': '#665fd1',702 'dark lilac': '#9c6da5',703 'reddish': '#c44240',704 'light maroon': '#a24857',705 'dusty purple': '#825f87',706 'terra cotta': '#c9643b',707 'avocado': '#90b134',708 'marine blue': '#01386a',709 'teal green': '#25a36f',710 'slate grey': '#59656d',711 'lighter green': '#75fd63',712 'electric green': '#21fc0d',713 'dusty blue': '#5a86ad',714 'golden yellow': '#fec615',715 'bright yellow': '#fffd01',716 'light lavender': '#dfc5fe',717 'umber': '#b26400',718 'poop': '#7f5e00',719 'dark peach': '#de7e5d',720 'jungle green': '#048243',721 'eggshell': '#ffffd4',722 'denim': '#3b638c',723 'yellow brown': '#b79400',724 'dull purple': '#84597e',725 'chocolate brown': '#411900',726 'wine red': '#7b0323',727 'neon blue': '#04d9ff',728 'dirty green': '#667e2c',729 'light tan': '#fbeeac',730 'ice blue': '#d7fffe',731 'cadet blue': '#4e7496',732 'dark mauve': '#874c62',733 'very light blue': '#d5ffff',734 'grey purple': '#826d8c',735 'pastel pink': '#ffbacd',736 'very light green': '#d1ffbd',737 'dark sky blue': '#448ee4',738 'evergreen': '#05472a',739 'dull pink': '#d5869d',740 'aubergine': '#3d0734',741 'mahogany': '#4a0100',742 'reddish orange': '#f8481c',743 'deep green': '#02590f',744 'vomit green': '#89a203',745 'purple pink': '#e03fd8',746 'dusty pink': '#d58a94',747 'faded green': '#7bb274',748 'camo green': '#526525',749 'pinky purple': '#c94cbe',750 'pink purple': '#db4bda',751 'brownish red': '#9e3623',752 'dark rose': '#b5485d',753 'mud': '#735c12',754 'brownish': '#9c6d57',755 'emerald green': '#028f1e',756 'pale brown': '#b1916e',757 'dull blue': '#49759c',758 'burnt umber': '#a0450e',759 'medium green': '#39ad48',760 'clay': '#b66a50',761 'light aqua': '#8cffdb',762 'light olive green': '#a4be5c',763 'brownish orange': '#cb7723',764 'dark aqua': '#05696b',765 'purplish pink': '#ce5dae',766 'dark salmon': '#c85a53',767 'greenish grey': '#96ae8d',768 'jade': '#1fa774',769 'ugly green': '#7a9703',770 'dark beige': '#ac9362',771 'emerald': '#01a049',772 'pale red': '#d9544d',773 'light magenta': '#fa5ff7',774 'sky': '#82cafc',775 'light cyan': '#acfffc',776 'yellow orange': '#fcb001',777 'reddish purple': '#910951',778 'reddish pink': '#fe2c54',779 'orchid': '#c875c4',780 'dirty yellow': '#cdc50a',781 'orange red': '#fd411e',782 'deep red': '#9a0200',783 'orange brown': '#be6400',784 'cobalt blue': '#030aa7',785 'neon pink': '#fe019a',786 'rose pink': '#f7879a',787 'greyish purple': '#887191',788 'raspberry': '#b00149',789 'aqua green': '#12e193',790 'salmon pink': '#fe7b7c',791 'tangerine': '#ff9408',792 'brownish green': '#6a6e09',793 'red brown': '#8b2e16',794 'greenish brown': '#696112',795 'pumpkin': '#e17701',796 'pine green': '#0a481e',797 'charcoal': '#343837',798 'baby pink': '#ffb7ce',799 'cornflower': '#6a79f7',800 'blue violet': '#5d06e9',801 'chocolate': '#3d1c02',802 'greyish green': '#82a67d',803 'scarlet': '#be0119',804 'green yellow': '#c9ff27',805 'dark olive': '#373e02',806 'sienna': '#a9561e',807 'pastel purple': '#caa0ff',808 'terracotta': '#ca6641',809 'aqua blue': '#02d8e9',810 'sage green': '#88b378',811 'blood red': '#980002',812 'deep pink': '#cb0162',813 'grass': '#5cac2d',814 'moss': '#769958',815 'pastel blue': '#a2bffe',816 'bluish green': '#10a674',817 'green blue': '#06b48b',818 'dark tan': '#af884a',819 'greenish blue': '#0b8b87',820 'pale orange': '#ffa756',821 'vomit': '#a2a415',822 'forrest green': '#154406',823 'dark lavender': '#856798',824 'dark violet': '#34013f',825 'purple blue': '#632de9',826 'dark cyan': '#0a888a',827 'olive drab': '#6f7632',828 'pinkish': '#d46a7e',829 'cobalt': '#1e488f',830 'neon purple': '#bc13fe',831 'light turquoise': '#7ef4cc',832 'apple green': '#76cd26',833 'dull green': '#74a662',834 'wine': '#80013f',835 'powder blue': '#b1d1fc',836 'off white': '#ffffe4',837 'electric blue': '#0652ff',838 'dark turquoise': '#045c5a',839 'blue purple': '#5729ce',840 'azure': '#069af3',841 'bright red': '#ff000d',842 'pinkish red': '#f10c45',843 'cornflower blue': '#5170d7',844 'light olive': '#acbf69',845 'grape': '#6c3461',846 'greyish blue': '#5e819d',847 'purplish blue': '#601ef9',848 'yellowish green': '#b0dd16',849 'greenish yellow': '#cdfd02',850 'medium blue': '#2c6fbb',851 'dusty rose': '#c0737a',852 'light violet': '#d6b4fc',853 'midnight blue': '#020035',854 'bluish purple': '#703be7',855 'red orange': '#fd3c06',856 'dark magenta': '#960056',857 'greenish': '#40a368',858 'ocean blue': '#03719c',859 'coral': '#fc5a50',860 'cream': '#ffffc2',861 'reddish brown': '#7f2b0a',862 'burnt sienna': '#b04e0f',863 'brick': '#a03623',864 'sage': '#87ae73',865 'grey green': '#789b73',866 'white': '#ffffff',867 "robin's egg blue": '#98eff9',868 'moss green': '#658b38',869 'steel blue': '#5a7d9a',870 'eggplant': '#380835',871 'light yellow': '#fffe7a',872 'leaf green': '#5ca904',873 'light grey': '#d8dcd6',874 'puke': '#a5a502',875 'pinkish purple': '#d648d7',876 'sea blue': '#047495',877 'pale purple': '#b790d4',878 'slate blue': '#5b7c99',879 'blue grey': '#607c8e',880 'hunter green': '#0b4008',881 'fuchsia': '#ed0dd9',882 'crimson': '#8c000f',883 'pale yellow': '#ffff84',884 'ochre': '#bf9005',885 'mustard yellow': '#d2bd0a',886 'light red': '#ff474c',887 'cerulean': '#0485d1',888 'pale pink': '#ffcfdc',889 'deep blue': '#040273',890 'rust': '#a83c09',891 'light teal': '#90e4c1',892 'slate': '#516572',893 'goldenrod': '#fac205',894 'dark yellow': '#d5b60a',895 'dark grey': '#363737',896 'army green': '#4b5d16',897 'grey blue': '#6b8ba4',898 'seafoam': '#80f9ad',899 'puce': '#a57e52',900 'spring green': '#a9f971',901 'dark orange': '#c65102',902 'sand': '#e2ca76',903 'pastel green': '#b0ff9d',904 'mint': '#9ffeb0',905 'light orange': '#fdaa48',906 'bright pink': '#fe01b1',907 'chartreuse': '#c1f80a',908 'deep purple': '#36013f',909 'dark brown': '#341c02',910 'taupe': '#b9a281',911 'pea green': '#8eab12',912 'puke green': '#9aae07',913 'kelly green': '#02ab2e',914 'seafoam green': '#7af9ab',915 'blue green': '#137e6d',916 'khaki': '#aaa662',917 'burgundy': '#610023',918 'dark teal': '#014d4e',919 'brick red': '#8f1402',920 'royal purple': '#4b006e',921 'plum': '#580f41',922 'mint green': '#8fff9f',923 'gold': '#dbb40c',924 'baby blue': '#a2cffe',925 'yellow green': '#c0fb2d',926 'bright purple': '#be03fd',927 'dark red': '#840000',928 'pale blue': '#d0fefe',929 'grass green': '#3f9b0b',930 'navy': '#01153e',931 'aquamarine': '#04d8b2',932 'burnt orange': '#c04e01',933 'neon green': '#0cff0c',934 'bright blue': '#0165fc',935 'rose': '#cf6275',936 'light pink': '#ffd1df',937 'mustard': '#ceb301',938 'indigo': '#380282',939 'lime': '#aaff32',940 'sea green': '#53fca1',941 'periwinkle': '#8e82fe',942 'dark pink': '#cb416b',943 'olive green': '#677a04',944 'peach': '#ffb07c',945 'pale green': '#c7fdb5',946 'light brown': '#ad8150',947 'hot pink': '#ff028d',948 'black': '#000000',949 'lilac': '#cea2fd',950 'navy blue': '#001146',951 'royal blue': '#0504aa',952 'beige': '#e6daa6',953 'salmon': '#ff796c',954 'olive': '#6e750e',955 'maroon': '#650021',956 'bright green': '#01ff07',957 'dark purple': '#35063e',958 'mauve': '#ae7181',959 'forest green': '#06470c',960 'aqua': '#13eac9',961 'cyan': '#00ffff',962 'tan': '#d1b26f',963 'dark blue': '#00035b',964 'lavender': '#c79fef',965 'turquoise': '#06c2ac',966 'dark green': '#033500',967 'violet': '#9a0eea',968 'light purple': '#bf77f6',969 'lime green': '#89fe05',970 'grey': '#929591',971 'sky blue': '#75bbfd',972 'yellow': '#ffff14',973 'magenta': '#c20078',974 'light green': '#96f97b',975 'orange': '#f97306',976 'teal': '#029386',977 'light blue': '#95d0fc',978 'red': '#e50000',979 'brown': '#653700',980 'pink': '#ff81c0',981 'blue': '#0343df',982 'green': '#15b01a',983 'purple': '#7e1e9c'}984# Normalize name to "xkcd:<name>" to avoid name collisions.985XKCD_COLORS = {'xkcd:' + name: value for name, value in XKCD_COLORS.items()}986# https://drafts.csswg.org/css-color-4/#named-colors987CSS4_COLORS = {988 'aliceblue': '#F0F8FF',989 'antiquewhite': '#FAEBD7',990 'aqua': '#00FFFF',991 'aquamarine': '#7FFFD4',992 'azure': '#F0FFFF',993 'beige': '#F5F5DC',994 'bisque': '#FFE4C4',995 'black': '#000000',996 'blanchedalmond': '#FFEBCD',997 'blue': '#0000FF',998 'blueviolet': '#8A2BE2',999 'brown': '#A52A2A',1000 'burlywood': '#DEB887',1001 'cadetblue': '#5F9EA0',1002 'chartreuse': '#7FFF00',1003 'chocolate': '#D2691E',1004 'coral': '#FF7F50',1005 'cornflowerblue': '#6495ED',1006 'cornsilk': '#FFF8DC',1007 'crimson': '#DC143C',1008 'cyan': '#00FFFF',1009 'darkblue': '#00008B',1010 'darkcyan': '#008B8B',1011 'darkgoldenrod': '#B8860B',1012 'darkgray': '#A9A9A9',1013 'darkgreen': '#006400',1014 'darkgrey': '#A9A9A9',1015 'darkkhaki': '#BDB76B',1016 'darkmagenta': '#8B008B',1017 'darkolivegreen': '#556B2F',1018 'darkorange': '#FF8C00',1019 'darkorchid': '#9932CC',1020 'darkred': '#8B0000',1021 'darksalmon': '#E9967A',1022 'darkseagreen': '#8FBC8F',1023 'darkslateblue': '#483D8B',1024 'darkslategray': '#2F4F4F',1025 'darkslategrey': '#2F4F4F',1026 'darkturquoise': '#00CED1',1027 'darkviolet': '#9400D3',1028 'deeppink': '#FF1493',1029 'deepskyblue': '#00BFFF',1030 'dimgray': '#696969',1031 'dimgrey': '#696969',1032 'dodgerblue': '#1E90FF',1033 'firebrick': '#B22222',1034 'floralwhite': '#FFFAF0',1035 'forestgreen': '#228B22',1036 'fuchsia': '#FF00FF',1037 'gainsboro': '#DCDCDC',1038 'ghostwhite': '#F8F8FF',1039 'gold': '#FFD700',1040 'goldenrod': '#DAA520',1041 'gray': '#808080',1042 'green': '#008000',1043 'greenyellow': '#ADFF2F',1044 'grey': '#808080',1045 'honeydew': '#F0FFF0',1046 'hotpink': '#FF69B4',1047 'indianred': '#CD5C5C',1048 'indigo': '#4B0082',1049 'ivory': '#FFFFF0',1050 'khaki': '#F0E68C',1051 'lavender': '#E6E6FA',1052 'lavenderblush': '#FFF0F5',1053 'lawngreen': '#7CFC00',1054 'lemonchiffon': '#FFFACD',1055 'lightblue': '#ADD8E6',1056 'lightcoral': '#F08080',1057 'lightcyan': '#E0FFFF',1058 'lightgoldenrodyellow': '#FAFAD2',1059 'lightgray': '#D3D3D3',1060 'lightgreen': '#90EE90',1061 'lightgrey': '#D3D3D3',1062 'lightpink': '#FFB6C1',1063 'lightsalmon': '#FFA07A',1064 'lightseagreen': '#20B2AA',1065 'lightskyblue': '#87CEFA',1066 'lightslategray': '#778899',1067 'lightslategrey': '#778899',1068 'lightsteelblue': '#B0C4DE',1069 'lightyellow': '#FFFFE0',1070 'lime': '#00FF00',1071 'limegreen': '#32CD32',1072 'linen': '#FAF0E6',1073 'magenta': '#FF00FF',1074 'maroon': '#800000',1075 'mediumaquamarine': '#66CDAA',1076 'mediumblue': '#0000CD',1077 'mediumorchid': '#BA55D3',1078 'mediumpurple': '#9370DB',1079 'mediumseagreen': '#3CB371',1080 'mediumslateblue': '#7B68EE',1081 'mediumspringgreen': '#00FA9A',1082 'mediumturquoise': '#48D1CC',1083 'mediumvioletred': '#C71585',1084 'midnightblue': '#191970',1085 'mintcream': '#F5FFFA',1086 'mistyrose': '#FFE4E1',1087 'moccasin': '#FFE4B5',1088 'navajowhite': '#FFDEAD',1089 'navy': '#000080',1090 'oldlace': '#FDF5E6',1091 'olive': '#808000',1092 'olivedrab': '#6B8E23',1093 'orange': '#FFA500',1094 'orangered': '#FF4500',1095 'orchid': '#DA70D6',1096 'palegoldenrod': '#EEE8AA',1097 'palegreen': '#98FB98',1098 'paleturquoise': '#AFEEEE',1099 'palevioletred': '#DB7093',1100 'papayawhip': '#FFEFD5',1101 'peachpuff': '#FFDAB9',1102 'peru': '#CD853F',1103 'pink': '#FFC0CB',1104 'plum': '#DDA0DD',1105 'powderblue': '#B0E0E6',1106 'purple': '#800080',1107 'rebeccapurple': '#663399',1108 'red': '#FF0000',1109 'rosybrown': '#BC8F8F',1110 'royalblue': '#4169E1',1111 'saddlebrown': '#8B4513',1112 'salmon': '#FA8072',1113 'sandybrown': '#F4A460',1114 'seagreen': '#2E8B57',1115 'seashell': '#FFF5EE',1116 'sienna': '#A0522D',1117 'silver': '#C0C0C0',1118 'skyblue': '#87CEEB',1119 'slateblue': '#6A5ACD',1120 'slategray': '#708090',1121 'slategrey': '#708090',1122 'snow': '#FFFAFA',1123 'springgreen': '#00FF7F',1124 'steelblue': '#4682B4',1125 'tan': '#D2B48C',1126 'teal': '#008080',1127 'thistle': '#D8BFD8',1128 'tomato': '#FF6347',1129 'turquoise': '#40E0D0',1130 'violet': '#EE82EE',1131 'wheat': '#F5DEB3',1132 'white': '#FFFFFF',1133 'whitesmoke': '#F5F5F5',1134 'yellow': '#FFFF00',...
blur.py
Source:blur.py
1"""2File: blur.py3Name:4-------------------------------5This file shows the original image first,6smiley-face.png, and then compare to its7blurred image. The blur algorithm uses the8average RGB values of a pixel's nearest neighbors.9"""10from simpleimage import SimpleImage11BLUR_INDEX = 512def main():13 """14 TODO: put in a picture and show the blurred version of it15 """16 old_img = SimpleImage("images/smiley-face.png")17 old_img.show()18 blurred_img = blur(old_img)19 for i in range(BLUR_INDEX):20 blurred_img = blur(blurred_img)21 blurred_img.show()22def blur(img):23 """24 :param img: An image to be blurred25 :return: a blurred image26 """27 new_img = SimpleImage.blank(img.width, img.height)28 for x in range(img.width):29 for y in range(img.height):30 pixel = new_img.get_pixel(x, y)31 sum_red = 032 sum_blue = 033 sum_green = 034 if x == 0:35 if y == 0:36 for i in range(0, 2):37 for j in range(0, 2):38 neighbor = img.get_pixel(x + i, y + j)39 sum_red += neighbor.red40 sum_blue += neighbor.blue41 sum_green += neighbor.green42 pixel.red = sum_red / 443 pixel.blue = sum_blue / 444 pixel.green = sum_green / 445 elif y == img.height-1:46 for i in range(0, 2):47 for j in range(-1, 1):48 neighbor = img.get_pixel(x + i, y + j)49 sum_red += neighbor.red50 sum_blue += neighbor.blue51 sum_green += neighbor.green52 pixel.red = sum_red / 453 pixel.blue = sum_blue / 454 pixel.green = sum_green / 455 else:56 for i in range(0, 2):57 for j in range(-1, 2):58 neighbor = img.get_pixel(x + i, y + j)59 sum_red += neighbor.red60 sum_blue += neighbor.blue61 sum_green += neighbor.green62 pixel.red = sum_red / 663 pixel.blue = sum_blue / 664 pixel.green = sum_green / 665 elif y == 0:66 if x == img.width-1:67 for i in range(-1, 1):68 for j in range(0, 2):69 neighbor = img.get_pixel(x + i, y + j)70 sum_red += neighbor.red71 sum_blue += neighbor.blue72 sum_green += neighbor.green73 pixel.red = sum_red / 474 pixel.blue = sum_blue / 475 pixel.green = sum_green / 476 else:77 for i in range(-1, 2):78 for j in range(0, 2):79 neighbor = img.get_pixel(x + i, y + j)80 sum_red += neighbor.red81 sum_blue += neighbor.blue82 sum_green += neighbor.green83 pixel.red = sum_red / 684 pixel.blue = sum_blue / 685 pixel.green = sum_green / 686 elif x == img.width-1:87 if y == img.height-1:88 for i in range(-1, 1):89 for j in range(-1, 1):90 neighbor = img.get_pixel(x + i, y + j)91 sum_red += neighbor.red92 sum_blue += neighbor.blue93 sum_green += neighbor.green94 pixel.red = sum_red / 495 pixel.blue = sum_blue / 496 pixel.green = sum_green / 497 else:98 for i in range(-1, 1):99 for j in range(-1, 2):100 neighbor = img.get_pixel(x + i, y + j)101 sum_red += neighbor.red102 sum_blue += neighbor.blue103 sum_green += neighbor.green104 pixel.red = sum_red / 6105 pixel.blue = sum_blue / 6106 pixel.green = sum_green / 6107 elif y == img.height-1:108 for i in range(-1, 2):109 for j in range(-1, 1):110 neighbor = img.get_pixel(x + i, y + j)111 sum_red += neighbor.red112 sum_blue += neighbor.blue113 sum_green += neighbor.green114 pixel.red = sum_red / 6115 pixel.blue = sum_blue / 6116 pixel.green = sum_green / 6117 else:118 for i in range(-1, 2):119 for j in range(-1, 2):120 neighbor = img.get_pixel(x+i, y+j)121 sum_red += neighbor.red122 sum_blue += neighbor.blue123 sum_green += neighbor.green124 pixel.red = sum_red/9125 pixel.blue = sum_blue/9126 pixel.green = sum_green/9127 return new_img128# ---- DO NOT EDIT CODE BELOW THIS LINE ---- #129if __name__ == '__main__':...
traffic_light_node.py
Source:traffic_light_node.py
...55 self.traffic_light_state[light]=False56 else:57 self.led.setRGB(light,[1,1,0])58 self.traffic_light_state[light]=True59 def freqgreen(self,event):60 if self.green_on==False: #Exit if lights should all be red61 return62 if self.traffic_light_state[self.green]==True:63 self.led.setRGB(self.green,[0,0,0])64 self.traffic_light_state[self.green]=False65 else:66 self.led.setRGB(self.green,self.green_color)67 self.traffic_light_state[self.green]=True68 def setupParameter(self,param_name,default_value):69 value = rospy.get_param(param_name,default_value)70 rospy.set_param(param_name,value) #Write to parameter server for transparancy71 rospy.loginfo("[%s] %s = %s " %(self.node_name,param_name,value))72 return value73if __name__ == '__main__':...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!