Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color Map #49

Open
andyg2 opened this issue Mar 29, 2023 · 3 comments
Open

Color Map #49

andyg2 opened this issue Mar 29, 2023 · 3 comments

Comments

@andyg2
Copy link

andyg2 commented Mar 29, 2023

Wouldn't this be a lot more efficient, it's more colors that ChatGPT knows.

let color_map = [
  '#D0312D' => 'RED',
  '#990F02' => 'CHERRY RED',
  '#E3242B' => 'ROSE',
  '#60100B' => 'JAM',
  '#541E1B' => 'MERLOT',
  '#610C04' => 'GARNET',
  '#B90E0A' => 'CRIMSON',
  '#900603' => 'RUBY',
  '#900D09' => 'SCARLET',
  '#4E0707' => 'WINE',
  '#7E2811' => 'BRICK',
  '#A91B0D' => 'APPLE',
  '#420C09' => 'MAHOGANY',
  '#710C04' => 'BLOOD',
  '#5E1916' => 'SANGRIA RED',
  '#7A1712' => 'BERRY',
  '#680C07' => 'CURRANT',
  '#BC544B' => 'BLUSH RED',
  '#D21404' => 'CANDY',
  '#9B1003' => 'LIPSTICK',
  '#960018' => 'CARMINE',
  '#CA3433' => 'PERSIAN RED',
  '#7E191B' => 'VERMILION',
  '#ED2939' => 'IMPERIAL RED',
  '#CD5C5C' => 'INDIAN RED',
  '#C21807' => 'CHILI RED',
  '#800000' => 'MAROON',
  '#B22222' => 'FIRE BRICK',
  '#EA3C53' => 'DESIRE',
  '#D21F3C' => 'RASPBERRY',
  '#FF0800' => 'CANDY APPLE',
  '#B43757' => 'HIBISCUS',
  '#BF0A30' => 'U.S. FLAG',
  '#FF2800' => 'FERRARI',
  '#8D021F' => 'BURGUNDY',
  '#8B0000' => 'DARK RED',
  '#D03D33' => 'PRISMATIC RED',
  '#AA0000' => '49ERS RED',
  '#BD2031' => 'CARDINALS RED',
  '#D2122E' => 'AJAX RED',
  '#9E1B32' => 'ALABAMA CRIMSON',
  '#E32636' => 'ALIZARIN CRIMSON',
  '#F4364C' => 'AMARANTH RED',
  '#FF033E' => 'AMERICAN ROSE',
  '#BA0021' => 'ANGELS RED',
  '#DB0007' => 'ARSENAL RED',
  '#A52A2A' => 'AUBURN RED',
  '#CC0000' => 'BU SCARLET',
  '#C60C30' => 'BILLS RED',
  '#BF4F51' => 'BITTERSWEET SHIMMER',
  '#ED7014' => 'ORANGE',
  '#FA8128' => 'TANGERINE',
  '#FCAE1E' => 'MERIGOLD',
  '#B56727' => 'CIDER',
  '#8D4004' => 'RUST',
  '#BE5504' => 'GINGER',
  '#FC6A03' => 'TIGER',
  '#DD571C' => 'FIRE',
  '#B2560D' => 'BRONZE',
  '#FDA172' => 'CANTALOUPE',
  '#ED820E' => 'APRICOT',
  '#80400B' => 'CLAY',
  '#EC9706' => 'HONEY',
  '#ED7117' => 'CARROT',
  '#C95B0C' => 'SQUASH',
  '#7A3803' => 'SPICE',
  '#D16002' => 'MARMALADE',
  '#893101' => 'AMBER',
  '#D67229' => 'SANDSTONE',
  '#CC5801' => 'YAM',
  '#FC4C02' => 'TANGELO',
  '#E34A27' => 'FLAME',
  '#E68000' => 'FULVOUS',
  '#FF8C00' => 'DARK ORANGE',
  '#FF5E0E' => 'VIVID ORANGE',
  '#FF4500' => 'ORANGE-RED',
  '#E26310' => 'METALLIC ORANGE',
  '#F5761A' => 'PUMPKIN',
  '#FD673A' => 'SMASHED PUMPKIN',
  '#FF4F00' => 'INTERNATIONAL ORANGE',
  '#F06105' => 'SPANISH ORANGE',
  '#FF8F00' => 'PRINCETON ORANGE',
  '#FFA52C' => 'DEEP SAFFRON',
  '#C35214' => 'ALLOY ORANGE',
  '#EE5921' => 'HALLOWEEN ORANGE',
  '#E89611' => 'GAMBOGE',
  '#CF5B2E' => 'MEDIUM VERMILION',
  '#FEBA4F' => 'PASTEL ORANGE',
  '#F26E01' => 'PHILIPPINE ORANGE',
  '#FF9944' => 'ROYAL ORANGE',
  '#FF7F50' => 'CORAL',
  '#D75341' => 'DARK CORAL',
  '#E6812F' => 'CADMIUM ORANGE',
  '#FABA5F' => 'RAJAH',
  '#FB8842' => 'MANGO TANGO',
  '#FF9F00' => 'ORANGE PEEL',
  '#EC7625' => 'VIVID TANGELO',
  '#EC5800' => 'PERSIMMON',
  '#FF3C00' => 'BROWNS ORANGE',
  '#CC5500' => 'BURNT ORANGE',
  '#E6DBAC' => 'TAN',
  '#EEDC9A' => 'BEIGE',
  '#F9E076' => 'MACAROON',
  '#C9BB8E' => 'HAZEL WOOD',
  '#D6B85A' => 'GRANOLA',
  '#DFC98A' => 'OAT',
  '#FAE29C' => 'EGG NOG',
  '#C8A951' => 'FAWN',
  '#F3EAAF' => 'SUGAR COOKIE',
  '#D8B863' => 'SAND',
  '#E3B778' => 'SEPIA',
  '#E7C27D' => 'LATTE',
  '#DCD7A0' => 'OYSTER',
  '#E3C565' => 'BISCOTTI',
  '#FDE992' => 'PARMESAN',
  '#BDA55D' => 'HAZELNUT',
  '#DAC17C' => 'SANDCASTLE',
  '#FDEFB2' => 'BUTTERMILK',
  '#EDE8BA' => 'SAND DOLLAR',
  '#FBE790' => 'SHORTBREAD',
  '#E4D00A' => 'CITRINE',
  '#EEDC82' => 'FLAX',
  '#EEED09' => 'XANTHIC',
  '#FFFD37' => 'SUNSHINE YELLOW',
  '#FFEF00' => 'CANARY YELLOW',
  '#FDFF00' => 'LEMON YELLOW',
  '#EEE8AA' => 'PALE GOLDENROD',
  '#F0E68C' => 'LIGHT KHAKI',
  '#FCE883' => 'CLOVER LIME',
  '#FADA5E' => 'ROYAL YELLOW',
  '#FFD700' => 'GOLD',
  '#EED202' => 'SAFETY YELLOW',
  '#F8E473' => 'LAGUNA',
  '#FFFD01' => 'BRIGHT YELLOW',
  '#EEEA62' => 'GREENISH YELLOW',
  '#FFDA03' => 'SUNFLOWER',
  '#FCE205' => 'BUMBLEBEE',
  '#FFFD74' => 'BUTTER',
  '#FFE36E' => 'YELLOW TAN',
  '#FFE135' => 'BANANA',
  '#FCD12A' => 'TUSCANY',
  '#C49102' => 'DIJON',
  '#FEDC56' => 'MUSTARD',
  '#FAFA37' => 'MAXIMUM YELLOW',
  '#F8DE7E' => 'MELLOW YELLOW',
  '#FFFF66' => 'UNMELLOW YELLOW',
  '#CCA01D' => 'LEMON CURRY',
  '#FDEE00' => 'AUREOLIN',
  '#FFFF33' => 'ELECTRIC YELLOW',
  '#FFFE71' => 'PASTEL YELLOW',
  '#3CB043' => 'GREEN',
  '#B0FC38' => 'CHARTREUSE',
  '#3A5311' => 'JUNIPER',
  '#728C69' => 'SAGE',
  '#AEF359' => 'LIME',
  '#5DBB63' => 'FERN',
  '#98BF64' => 'OLIVE',
  '#028A0F' => 'EMERALD',
  '#74B72E' => 'PEAR',
  '#466D1D' => 'MOSS',
  '#03AC13' => 'SHAMROCK',
  '#3DED97' => 'SEAFOAM',
  '#234F1E' => 'PINE',
  '#03C04A' => 'PARAKEET',
  '#99EDC3' => 'MINT',
  '#354A21' => 'SEAWEED',
  '#597D35' => 'PICKLE',
  '#B2D3C2' => 'PISTACHIO',
  '#32612D' => 'BASIL',
  '#607D3B' => 'CROCODILE',
  '#3B7A57' => 'AMAZON',
  '#568203' => 'AVOCADO',
  '#ACE1AF' => 'CELADON',
  '#0B6623' => 'FOREST GREEN',
  '#3F704D' => 'HUNTER GREEN',
  '#8F9779' => 'ARTICHOKE GREEN',
  '#29AB87' => 'JUNGLE GREEN',
  '#00755E' => 'TROPICAL RAINFOREST',
  '#00A693' => 'PERSIAN GREEN',
  '#2E8B57' => 'SEA GREEN',
  '#00A86B' => 'JADE GREEN',
  '#A9BA9D' => 'LAUREL GREEN',
  '#4B5320' => 'ARMY GREEN',
  '#4CBB17' => 'KELLY GREEN',
  '#50C878' => 'PARIS GREEN',
  '#006600' => 'PAKISTAN GREEN',
  '#00F0A8' => 'SPRING',
  '#48A860' => 'CHATEAU',
  '#A8C090' => 'SWAMP',
  '#74C365' => 'MANTIS',
  '#007848' => 'FUN',
  '#609078' => 'VIRIDIAN',
  '#6C7C59' => 'RESEDA GREEN',
  '#487800' => 'VERDUN',
  '#00563B' => 'CASTLETON GREEN',
  '#006A4E' => 'BOTTLE GREEN',
  '#006B3C' => 'CADMIUM GREEN',
  '#78866B' => 'CAMOUFLAGE GREEN',
  '#85BB65' => 'DOLLAR BILL',
  '#B2EC5D' => 'INCHWORM',
  '#3944BC' => 'BLUE',
  '#757C88' => 'SLATE',
  '#63C5DA' => 'SKY',
  '#0A1172' => 'NAVY',
  '#281E5D' => 'INDIGO',
  '#1338BE' => 'COBALT',
  '#48AAAD' => 'TEAL',
  '#016064' => 'OCEAN',
  '#022D36' => 'PEACOCK',
  '#1520A6' => 'AZURE',
  '#0492C2' => 'CERULEAN',
  '#2832C2' => 'LAPIS',
  '#2C3E4C' => 'SPRUCE',
  '#59788E' => 'STONE',
  '#1F456E' => 'AEGEAN',
  '#241571' => 'BLUEBERRY',
  '#151E3D' => 'DENIM',
  '#051094' => 'ADMIRAL',
  '#52B2BF' => 'SAPPHIRE',
  '#82EEFD' => 'ARCTIC',
  '#40E0D0' => 'TURQUOISE',
  '#4682B4' => 'STEEL',
  '#2E5894' => 'B’DAZZLED',
  '#B0E0E6' => 'POWDER BLUE',
  '#004F98' => 'US AIR FORCE ACADEMY BLUE',
  '#89CFF0' => 'BABY BLUE',
  '#BCD4E6' => 'BEAU BLUE',
  '#6CA0DC' => 'LITTLE BOY BLUE',
  '#81D8D0' => 'TIFFANY BLUE',
  '#4B9CD3' => 'CAROLINA BLUE',
  '#4F97A3' => 'TURKISH BLUE',
  '#73C2FB' => 'MAYA BLUE',
  '#6495ED' => 'CORNFLOWER BLUE',
  '#126180' => 'BLUE SAPPHIRE',
  '#1034A6' => 'EGYPTIAN BLUE',
  '#00356B' => 'YALE BLUE',
  '#1D2951' => 'SPACE CADET',
  '#005A92' => 'IMPERIAL BLUE',
  '#76ABDF' => 'RUDDY BLUE',
  '#72A0C1' => 'AIR SUPERIORITY BLUE',
  '#6BCAE2' => 'AQUAMARINE BLUE',
  '#6CB4EE' => 'ARGENTINA BLUE',
  '#002D62' => 'ASTROS NAVY',
  '#0066B2' => 'BAYERN BLUE',
  '#4F86F7' => 'BERRY BLUE',
  '#5072A7' => 'BLUE YONDER',
  '#318CE7' => 'BLEU DE FRANCE',
  '#6699CC' => 'BLUE-GRAY',
  '#0039A6' => 'BOEING BLUE',
  '#13274F' => 'BRAVES NAVY',
  '#A32CC4' => 'PURPLE',
  '#7A4988' => 'MAUVE',
  '#710193' => 'DARK VIOLET',
  '#630436' => 'BOYSENBERRY',
  '#E39FF6' => 'ELECTRIC LAVENDER',
  '#601A35' => 'PLUM',
  '#A1045A' => 'STRONG MAGENTA',
  '#B65FCF' => 'DEEP LILAC',
  '#663046' => 'GRAPE',
  '#BE93D4' => 'ROYAL PERIWINKLE',
  '#4D0F28' => 'SANGRIA PURPLE',
  '#311432' => 'EGGPLANT',
  '#67032F' => 'JAZZBERRY JAM',
  '#9867C6' => 'IRIS',
  '#9E7BB5' => 'HEATHER',
  '#A45EE5' => 'AMETHYST',
  '#290916' => 'RAISIN',
  '#AF69EF' => 'MEDIUM ORCHID',
  '#4C0121' => 'DARK MULBERRY',
  '#2C041C' => 'DEEP WINE',
  '#D8BFD8' => 'THISTLE',
  '#DA70D6' => 'ORCHID',
  '#8F00FF' => 'ELECTRIC VIOLET',
  '#9370DB' => 'MEDIUM PURPLE',
  '#9932CC' => 'DARK ORCHID',
  '#8B008B' => 'DARK MAGENTA',
  '#A020F0' => 'VERONICA',
  '#DF73FF' => 'HELIOTROPE',
  '#9A4EAE' => 'PURPUREUS',
  '#4E2A84' => 'NORTHWESTERN PURPLE',
  '#512888' => 'KSU PURPLE',
  '#86608E' => 'POMP AND POWER',
  '#880085' => 'MARDI GRAS',
  '#6C3082' => 'EMINENCE',
  '#78184A' => 'PANSY PURPLE',
  '#72246C' => 'PALATINATE',
  '#301934' => 'DARK PURPLE',
  '#702963' => 'BYZANTIUM',
  '#563C5C' => 'ENGLISH VIOLET',
  '#6F4685' => 'AFFAIR',
  '#6F456E' => 'LONG DISTANCE',
  '#493F5E' => 'PRINCE CHARMING',
  '#8E4785' => 'LIPSTICK STAIN',
  '#720058' => 'POMPADOUR',
  '#6F2DA8' => 'GRAPE COLOR',
  '#9A2CA0' => 'PIZZA EDGE',
  '#66023C' => 'TYRIAN PURPLE',
  '#645394' => 'ULTRA VIOLET',
  '#BF00FF' => 'ELECTRIC PURPLE',
  '#7851A9' => 'STUDIO',
  '#F699CD' => 'PINK',
  '#FC94AF' => 'ROSE',
  '#FC46AA' => 'FRENCH FUCHSIA',
  '#F25278' => 'PUNCH',
  '#FEC5E5' => 'BLUSH PINK',
  '#FE7F9C' => 'WATERMELON',
  '#FDA4BA' => 'FLAMINGO',
  '#F26B8A' => 'ROUGE',
  '#FDAB9F' => 'LIGHT SALMON',
  '#FE7D6A' => 'CORAL PINK',
  '#FC9483' => 'PEACH',
  '#FC4C4E' => 'STRAWBERRY',
  '#9E4244' => 'ROSEWOOD',
  '#FCBACB' => 'LEMONADE',
  '#FA86C4' => 'TAFFY',
  '#FD5DA8' => 'BUBBLEGUM',
  '#F79AC0' => 'BALLET SLIPPER',
  '#F2B8C6' => 'LEMONADE CREPE',
  '#E11584' => 'MAGENTA PROCESS',
  '#FF1694' => 'HOT PINK',
  '#E52B50' => 'AMARANTH PINK',
  '#E3256B' => 'RAZZMATAZZ',
  '#FFA6C9' => 'CARNATION',
  '#FF9999' => 'SALMON',
  '#FFB6C1' => 'LIGHT PINK',
  '#FFD1DC' => 'PASTEL PINK',
  '#FFB7C5' => 'CHERRY BLOSSOM',
  '#F4C2C2' => 'BABY PINK',
  '#E75480' => 'DARK PINK',
  '#FF007F' => 'BRIGHT PINK',
  '#FF6EC7' => 'NEON PINK',
  '#FF00FF' => 'MAGENTA',
  '#FF8E8E' => 'TULIP PINK',
  '#FDDDE6' => 'PIGGY PINK',
  '#FFBCD9' => 'COTTON CANDY',
  '#EFBBCC' => 'CAMEO PINK',
  '#F64A8A' => 'FRENCH PINK',
  '#F77FBE' => 'PERSIAN PINK',
  '#E4717A' => 'CANDY PINK',
  '#DE3163' => 'CHERRY PINK',
  '#CC4E5C' => 'DARK TERRA COTTA',
  '#FF1493' => 'DEEP PINK',
  '#E5CCC9' => 'DUST STORM',
  '#F6ADC6' => 'NADESHIKO PINK',
  '#FF43A4' => 'WILD STRAWBERRY',
  '#D10056' => 'RUBINE RED',
  '#F400A1' => 'HOLLYWOOD CERISE',
  '#E4007C' => 'MEXICAN PINK',
  '#CC3366' => 'STEEL PINK',
  '#F9429E' => 'ROSE BONBON',
  '#231709' => 'BROWN OIL',
  '#4B371C' => 'ROASTED COFFEE',
  '#3C280D' => 'MOCHA',
  '#795C34' => 'PEANUT BROWN',
  '#362511' => 'CAROB',
  '#371D10' => 'HICKORY',
  '#3F301D' => 'WOOD',
  '#4A2511' => 'PECAN',
  '#432616' => 'WALNUT',
  '#65350F' => 'CARAMEL',
  '#5E2C04' => 'GINGERBREAD',
  '#481F01' => 'SYRUP',
  '#2E1503' => 'DARK CHOCOLATE',
  '#9A7B4F' => 'TORTILLA',
  '#352315' => 'UMBER',
  '#80471C' => 'TAWNY',
  '#3B1E08' => 'BRUNETTE',
  '#652A0E' => 'CINNAMON BROWN',
  '#532915' => 'PENNY',
  '#4A3728' => 'CEDAR BROWN',
  '#9F8170' => 'BEAVER',
  '#3D2B1F' => 'BISTRE',
  '#79443B' => 'BOLE',
  '#8A3324' => 'BURNT UMBER',
  '#A67B5B' => 'CAFE AU LAIT',
  '#4B3621' => 'CAFE NOIR',
  '#6F4E37' => 'COFFEE',
  '#704241' => 'DEEP COFFEE',
  '#B87333' => 'COPPER',
  '#654321' => 'DARK BROWN',
  '#483C32' => 'TAUPE',
  '#C2B280' => 'ECRU',
  '#996515' => 'GOLDEN BROWN',
  '#C3B091' => 'KHAKI',
  '#CC7722' => 'OCHRE',
  '#B5651D' => 'LIGHT BROWN',
  '#8B4513' => 'SADDLE BROWN',
  '#80461B' => 'RUSSET',
  '#A0522D' => 'SIENNA',
  '#CD9575' => 'ANTIQUE BRASS',
  '#DEB887' => 'BURLYWOOD',
  '#CD853F' => 'PERU',
  '#DEAA88' => 'TUMBLEWEED',
  '#D1BEA8' => 'DARK VANILLA',
  '#C19A6B' => 'WOOD BROWN',
  '#A0785A' => 'CHAMOISEE',
  '#BA8759' => 'DEER',
  '#9B7653' => 'DIRT',
  '#965A3E' => 'COCONUT',
  '#A75502' => 'WINDSOR TAN',
  '#000000' => 'BLACK',
  '#080402' => 'EBONY',
  '#0D0907' => 'CROW',
  '#28231D' => 'CHARCOAL',
  '#040406' => 'MIDNIGHT',
  '#070504' => 'INK',
  '#050301' => 'RAVEN',
  '#050100' => 'OIL',
  '#0A0806' => 'GREASE',
  '#030104' => 'ONYX',
  '#030001' => 'PITCH',
  '#160D08' => 'SOOT',
  '#060606' => 'SABLE',
  '#030303' => 'JET BLACK',
  '#0C0908' => 'COAL',
  '#0E0C0A' => 'METAL',
  '#020403' => 'OBSIDIAN',
  '#000302' => 'JADE',
  '#040200' => 'SPIDER',
  '#0B0705' => 'LEATHER',
  '#0C0404' => 'ASPHALT',
  '#1A1110' => 'LICORICE',
  '#0C090A' => 'NIGHT',
  '#232B2B' => 'CHARLESTON GREEN',
  '#1A2421' => 'DARK JUNGLE GREEN',
  '#1B1B1B' => 'EERIE BLACK',
  '#242124' => 'RAISIN BLACK',
  '#100C08' => 'SMOKY BLACK',
  '#010127' => 'BLACK ROCK',
  '#0B0B0B' => 'NEUTRAL BLACK',
  '#191C27' => 'BLACK DENIM',
  '#0F0404' => 'VAMPIRE BLACK',
  '#151922' => 'COOL BLACK',
  '#191C20' => 'FROST BLACK',
  '#0E0C01' => 'POWER BLACK',
  '#100E09' => 'PREMIUM BLACK',
  '#0B0510' => 'BLACK MAGIC',
  '#1A2228' => 'ALIEN BLACK',
  '#1B1811' => 'BLACK CHOCOLATE',
  '#120321' => 'GOTHIC GRAPE',
  '#1A1A1A' => 'METROPOLIS',
  '#1C1C1C' => 'NIGHT SHADOW',
  '#1A0F0F' => 'DARK RAISIN',
  '#161311' => 'TEA BAG',
  '#0D0E0E' => 'TECH BLACK',
  '#161616' => 'DULL BLACK',
  '#010203' => 'DARK BLACK',
  '#07000B' => 'NATURAL BLACK',
  '#1F201F' => 'RETRO BLACK',
  '#050203' => 'DEEP BLACK',
  '#808080' => 'GRAY',
  '#373737' => 'SHADOW',
  '#594D5B' => 'GRAPHITE',
  '#322D31' => 'IRON',
  '#696880' => 'PEWTER',
  '#C5C6D0' => 'CLOUD',
  '#ADADC9' => 'SILVER',
  '#59515E' => 'SMOKE',
  '#3E3D53' => 'DARK SLATE',
  '#41424C' => 'ANCHOR',
  '#564C4D' => 'ASH',
  '#4D4C5C' => 'PORPOISE',
  '#7C6E7F' => 'DOVE',
  '#655967' => 'FOG',
  '#7F7D9C' => 'FLINT',
  '#232023' => 'CHARCOAL GRAY',
  '#333333' => 'PEBBLE',
  '#3F3F4E' => 'LEAD',
  '#9897A9' => 'COIN',
  '#787276' => 'FOSSIL',
  '#3B444B' => 'ARSENIC',
  '#666A6D' => 'NEVADA',
  '#5E5E5E' => 'SCORPION',
  '#848482' => 'BATTLESHIP GRAY',
  '#625D5D' => 'CARBON GRAY',
  '#555555' => 'DAVY’S GRAY',
  '#696969' => 'DIM GRAY',
  '#B6B6B4' => 'GRAY CLOUD',
  '#5C5858' => 'GRAY DOLPHIN',
  '#504A4B' => 'GRAY WOLF',
  '#2A3439' => 'GUNMETAL',
  '#4C5866' => 'MARENGO',
  '#BEBEBE' => 'MEDIUM GRAY',
  '#727472' => 'NICKEL',
  '#928E85' => 'STONE GRAY',
  '#414A4C' => 'OUTER SPACE',
  '#8A7F8D' => 'ROCKET METALLIC',
  '#ACACAC' => 'SILVER CHALICE',
  '#726E6D' => 'SMOKEY GRAY',
  '#757575' => 'SONIC GRAY',
  '#989898' => 'SPANISH GRAY',
  '#8B8589' => 'TAUPE GRAY',
  '#565051' => 'VAMPIRE GRAY',
  '#BBBCB6' => 'X11 GRAY',
  '#746D69' => 'DARK SILVER',
  '#CCCDC6' => 'PASTEL GRAY',
  '#BCC2C2' => 'MISTY GRAY',
  '#989692' => 'VINTAGE GRAY',
  '#63645E' => 'ZOMBIE GRAY',
  '#A1A1A1' => 'PERFECT GRAY',
  '#FFFFFF' => 'WHITE',
  '#FBFCF8' => 'PEARL',
  '#FEF9F3' => 'ALABASTER',
  '#F5FEFD' => 'SNOW',
  '#FDF6E4' => 'PALE IVORY',
  '#FFFADA' => 'CREAM',
  '#FFF9E3' => 'EGGSHELL',
  '#FBFBF9' => 'COTTON',
  '#FBFAF2' => 'CHIFFON',
  '#F8EEEC' => 'PINK SALT',
  '#F8F2ED' => 'LACE',
  '#FFF1E6' => 'COCONUT MILK',
  '#F3EAD3' => 'LINEN',
  '#E7DECC' => 'BONE',
  '#FAFAFA' => 'DAISY',
  '#FBFCFA' => 'POWDER',
  '#ECFBFC' => 'FROST',
  '#FFFEFC' => 'PORCELAIN',
  '#FBF5DF' => 'PARCHMENT',
  '#FAF5EF' => 'RICE',
  '#FFF5EE' => 'SEASHELL',
  '#F1F9EC' => 'PEPPERMINT',
  '#FDFFF5' => 'MILK',
  '#F8F8FF' => 'GHOST WHITE',
  '#F5F5F5' => 'WHITE SMOKE',
  '#FEFEFA' => 'BABY POWDER',
  '#FFFFF0' => 'IVORY',
  '#FFFAF0' => 'FLORAL WHITE',
  '#ECF3F9' => 'LINK WHITE',
  '#FFFAFA' => 'ROSE WHITE',
  '#FDFCFA' => 'VISTA WHITE',
  '#F8FBF8' => 'SNOW DRIFT',
  '#FFFCEC' => 'ISLAND SPICE',
  '#F6F1F4' => 'SOFT PEACH',
  '#EBF5F0' => 'HARP',
  '#F6F4F1' => 'COUGH MIXTURE',
  '#EBF6F7' => 'CUP CAKE',
  '#F8F4FF' => 'MAGNOLIA',
  '#F2F3F4' => 'ANTI-FLASH WHITE',
  '#F7F5F6' => 'CASCADING WHITE',
  '#F2F7FD' => 'COTTON BALL',
  '#F8F8E8' => 'PHOTON WHITE',
  '#FDF9EF' => 'WHITE HEAT',
  '#FEFFFC' => 'WHITEWASH',
  '#EEF1EA' => 'SHADOW WHITE',
  '#EFECE1' => 'ACOUSTIC WHITE',
  '#EDF2F8' => 'AIRCRAFT WHITE',
  '#FCFFF9' => 'CERAMIC',
  '#EDF1FE' => 'BRILLIANT WHITE'
];
@andyg2
Copy link
Author

andyg2 commented Mar 29, 2023

  function get_closest(hex) {
    let color = hex.toUpperCase();
    let minDistance = Number.MAX_SAFE_INTEGER;
    let closestColorName = '';
    
    for (let c in colors) {
      let distance = getDistance(color, c);
      if (distance < minDistance) {
        minDistance = distance;
        closestColorName = colors[c];
      }
    }
    
    return closestColorName;
  }
  
  function getDistance(c1, c2) {
    let r1 = parseInt(c1.substr(0, 2), 16);
    let g1 = parseInt(c1.substr(2, 2), 16);
    let b1 = parseInt(c1.substr(4, 2), 16);
    let r2 = parseInt(c2.substr(0, 2), 16);
    let g2 = parseInt(c2.substr(2, 2), 16);
    let b2 = parseInt(c2.substr(4, 2), 16);
    
    let dr = r1 - r2;
    let dg = g1 - g2;
    let db = b1 - b2;
    
    return Math.sqrt(dr * dr + dg * dg + db * db);
  }
  
  let closest = get_closest('ADF0FE');

@crazy4groovy
Copy link

This review doesn't even mention color names, lol.

https://youtu.be/k0OhVtxJHMA?t=365

When I saw that I was like, why do I need to to connect chatGPT for a color grabber?? 😂

@andyg2
Copy link
Author

andyg2 commented Mar 30, 2023

Because there's 16 million possible colors to name. Even if you count the fact that some of them have the same color, you still have to build through a database that big and search through it.

ChatGPT doesn't know 16M color names, it knows 480, well that's all I could get out of it by asking e.g. what color names are between eggshell and pearl.
The code above gets the closest color name to any of the 16M hex codes. There's 550 colors in the list.

Tearing through your API allowance 10 times a second, is horrific.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants