Published
Dependencies: BLE_API TLC5955 mbed nRF51822
Fork of BLE_LoopbackUART by
Revision 14:73923b07ae4a, committed 2018-06-09
- Comitter:
- roysandberg
- Date:
- Sat Jun 09 23:23:06 2018 +0000
- Parent:
- 13:15764cc1f12c
- Commit message:
- Published
Changed in this revision
diff -r 15764cc1f12c -r 73923b07ae4a TLC5955.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TLC5955.lib Sat Jun 09 23:23:06 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/roysandberg/code/TLC5955/#ab6b451bbf40
diff -r 15764cc1f12c -r 73923b07ae4a color.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/color.h Sat Jun 09 23:23:06 2018 +0000 @@ -0,0 +1,2899 @@ +// https://github.com/codebrainz/color-names + +/* This file is auto-generated, do not edit. */ +#ifndef COLOR_H +#define COLOR_H + +#define COLOR_NAMES_MAX 865 + +typedef struct ColorListInfo { + const char* colorListName; + const int* colorList; +} ColorListInfo; + +typedef struct ColorInfo { + const char *name; + const char *hex; + struct { + unsigned char r; + unsigned char g; + unsigned char b; + } rgb; +} ColorInfo; + +typedef enum Color { + COLOR_AIR_FORCE_BLUE_RAF=0, + COLOR_AIR_FORCE_BLUE_USAF, + COLOR_AIR_SUPERIORITY_BLUE, + COLOR_ALABAMA_CRIMSON, + COLOR_ALICE_BLUE, + COLOR_ALIZARIN_CRIMSON, + COLOR_ALLOY_ORANGE, + COLOR_ALMOND, + COLOR_AMARANTH, + COLOR_AMBER, + COLOR_AMBER_SAE_ECE, + COLOR_AMERICAN_ROSE, + COLOR_AMETHYST, + COLOR_ANDROID_GREEN, + COLOR_ANTI_FLASH_WHITE, + COLOR_ANTIQUE_BRASS, + COLOR_ANTIQUE_FUCHSIA, + COLOR_ANTIQUE_RUBY, + COLOR_ANTIQUE_WHITE, + COLOR_AO_ENGLISH, + COLOR_APPLE_GREEN, + COLOR_APRICOT, + COLOR_AQUA, + COLOR_AQUAMARINE, + COLOR_ARMY_GREEN, + COLOR_ARSENIC, + COLOR_ARYLIDE_YELLOW, + COLOR_ASH_GREY, + COLOR_ASPARAGUS, + COLOR_ATOMIC_TANGERINE, + COLOR_AUBURN, + COLOR_AUREOLIN, + COLOR_AUROMETALSAURUS, + COLOR_AVOCADO, + COLOR_AZURE, + COLOR_AZURE_MIST_WEB, + COLOR_BABY_BLUE, + COLOR_BABY_BLUE_EYES, + COLOR_BABY_PINK, + COLOR_BALL_BLUE, + COLOR_BANANA_MANIA, + COLOR_BANANA_YELLOW, + COLOR_BARN_RED, + COLOR_BATTLESHIP_GREY, + COLOR_BAZAAR, + COLOR_BEAU_BLUE, + COLOR_BEAVER, + COLOR_BEIGE, + COLOR_BIG_DIP_O_RUBY, + COLOR_BISQUE, + COLOR_BISTRE, + COLOR_BITTERSWEET, + COLOR_BITTERSWEET_SHIMMER, + COLOR_BLACK, + COLOR_BLACK_BEAN, + COLOR_BLACK_LEATHER_JACKET, + COLOR_BLACK_OLIVE, + COLOR_BLANCHED_ALMOND, + COLOR_BLAST_OFF_BRONZE, + COLOR_BLEU_DE_FRANCE, + COLOR_BLIZZARD_BLUE, + COLOR_BLOND, + COLOR_BLUE, + COLOR_BLUE_BELL, + COLOR_BLUE_CRAYOLA, + COLOR_BLUE_GRAY, + COLOR_BLUE_GREEN, + COLOR_BLUE_MUNSELL, + COLOR_BLUE_NCS, + COLOR_BLUE_PIGMENT, + COLOR_BLUE_RYB, + COLOR_BLUE_SAPPHIRE, + COLOR_BLUE_VIOLET, + COLOR_BLUSH, + COLOR_BOLE, + COLOR_BONDI_BLUE, + COLOR_BONE, + COLOR_BOSTON_UNIVERSITY_RED, + COLOR_BOTTLE_GREEN, + COLOR_BOYSENBERRY, + COLOR_BRANDEIS_BLUE, + COLOR_BRASS, + COLOR_BRICK_RED, + COLOR_BRIGHT_CERULEAN, + COLOR_BRIGHT_GREEN, + COLOR_BRIGHT_LAVENDER, + COLOR_BRIGHT_MAROON, + COLOR_BRIGHT_PINK, + COLOR_BRIGHT_TURQUOISE, + COLOR_BRIGHT_UBE, + COLOR_BRILLIANT_LAVENDER, + COLOR_BRILLIANT_ROSE, + COLOR_BRINK_PINK, + COLOR_BRITISH_RACING_GREEN, + COLOR_BRONZE, + COLOR_BROWN_TRADITIONAL, + COLOR_BROWN_WEB, + COLOR_BUBBLE_GUM, + COLOR_BUBBLES, + COLOR_BUFF, + COLOR_BULGARIAN_ROSE, + COLOR_BURGUNDY, + COLOR_BURLYWOOD, + COLOR_BURNT_ORANGE, + COLOR_BURNT_SIENNA, + COLOR_BURNT_UMBER, + COLOR_BYZANTINE, + COLOR_BYZANTIUM, + COLOR_CADET, + COLOR_CADET_BLUE, + COLOR_CADET_GREY, + COLOR_CADMIUM_GREEN, + COLOR_CADMIUM_ORANGE, + COLOR_CADMIUM_RED, + COLOR_CADMIUM_YELLOW, + COLOR_CAF_AU_LAIT, + COLOR_CAF_NOIR, + COLOR_CAL_POLY_GREEN, + COLOR_CAMBRIDGE_BLUE, + COLOR_CAMEL, + COLOR_CAMEO_PINK, + COLOR_CAMOUFLAGE_GREEN, + COLOR_CANARY_YELLOW, + COLOR_CANDY_APPLE_RED, + COLOR_CANDY_PINK, + COLOR_CAPRI, + COLOR_CAPUT_MORTUUM, + COLOR_CARDINAL, + COLOR_CARIBBEAN_GREEN, + COLOR_CARMINE, + COLOR_CARMINE_M_P, + COLOR_CARMINE_PINK, + COLOR_CARMINE_RED, + COLOR_CARNATION_PINK, + COLOR_CARNELIAN, + COLOR_CAROLINA_BLUE, + COLOR_CARROT_ORANGE, + COLOR_CATALINA_BLUE, + COLOR_CEIL, + COLOR_CELADON, + COLOR_CELADON_BLUE, + COLOR_CELADON_GREEN, + COLOR_CELESTE_COLOUR, + COLOR_CELESTIAL_BLUE, + COLOR_CERISE, + COLOR_CERISE_PINK, + COLOR_CERULEAN, + COLOR_CERULEAN_BLUE, + COLOR_CERULEAN_FROST, + COLOR_CG_BLUE, + COLOR_CG_RED, + COLOR_CHAMOISEE, + COLOR_CHAMPAGNE, + COLOR_CHARCOAL, + COLOR_CHARM_PINK, + COLOR_CHARTREUSE_TRADITIONAL, + COLOR_CHARTREUSE_WEB, + COLOR_CHERRY, + COLOR_CHERRY_BLOSSOM_PINK, + COLOR_CHESTNUT, + COLOR_CHINA_PINK, + COLOR_CHINA_ROSE, + COLOR_CHINESE_RED, + COLOR_CHOCOLATE_TRADITIONAL, + COLOR_CHOCOLATE_WEB, + COLOR_CHROME_YELLOW, + COLOR_CINEREOUS, + COLOR_CINNABAR, + COLOR_CINNAMON, + COLOR_CITRINE, + COLOR_CLASSIC_ROSE, + COLOR_COBALT, + COLOR_COCOA_BROWN, + COLOR_COFFEE, + COLOR_COLUMBIA_BLUE, + COLOR_CONGO_PINK, + COLOR_COOL_BLACK, + COLOR_COOL_GREY, + COLOR_COPPER, + COLOR_COPPER_CRAYOLA, + COLOR_COPPER_PENNY, + COLOR_COPPER_RED, + COLOR_COPPER_ROSE, + COLOR_COQUELICOT, + COLOR_CORAL, + COLOR_CORAL_PINK, + COLOR_CORAL_RED, + COLOR_CORDOVAN, + COLOR_CORN, + COLOR_CORNELL_RED, + COLOR_CORNFLOWER_BLUE, + COLOR_CORNSILK, + COLOR_COSMIC_LATTE, + COLOR_COTTON_CANDY, + COLOR_CREAM, + COLOR_CRIMSON, + COLOR_CRIMSON_GLORY, + COLOR_CYAN, + COLOR_CYAN_PROCESS, + COLOR_DAFFODIL, + COLOR_DANDELION, + COLOR_DARK_BLUE, + COLOR_DARK_BROWN, + COLOR_DARK_BYZANTIUM, + COLOR_DARK_CANDY_APPLE_RED, + COLOR_DARK_CERULEAN, + COLOR_DARK_CHESTNUT, + COLOR_DARK_CORAL, + COLOR_DARK_CYAN, + COLOR_DARK_ELECTRIC_BLUE, + COLOR_DARK_GOLDENROD, + COLOR_DARK_GRAY, + COLOR_DARK_GREEN, + COLOR_DARK_IMPERIAL_BLUE, + COLOR_DARK_JUNGLE_GREEN, + COLOR_DARK_KHAKI, + COLOR_DARK_LAVA, + COLOR_DARK_LAVENDER, + COLOR_DARK_MAGENTA, + COLOR_DARK_MIDNIGHT_BLUE, + COLOR_DARK_OLIVE_GREEN, + COLOR_DARK_ORANGE, + COLOR_DARK_ORCHID, + COLOR_DARK_PASTEL_BLUE, + COLOR_DARK_PASTEL_GREEN, + COLOR_DARK_PASTEL_PURPLE, + COLOR_DARK_PASTEL_RED, + COLOR_DARK_PINK, + COLOR_DARK_POWDER_BLUE, + COLOR_DARK_RASPBERRY, + COLOR_DARK_RED, + COLOR_DARK_SALMON, + COLOR_DARK_SCARLET, + COLOR_DARK_SEA_GREEN, + COLOR_DARK_SIENNA, + COLOR_DARK_SLATE_BLUE, + COLOR_DARK_SLATE_GRAY, + COLOR_DARK_SPRING_GREEN, + COLOR_DARK_TAN, + COLOR_DARK_TANGERINE, + COLOR_DARK_TAUPE, + COLOR_DARK_TERRA_COTTA, + COLOR_DARK_TURQUOISE, + COLOR_DARK_VIOLET, + COLOR_DARK_YELLOW, + COLOR_DARTMOUTH_GREEN, + COLOR_DAVY_S_GREY, + COLOR_DEBIAN_RED, + COLOR_DEEP_CARMINE, + COLOR_DEEP_CARMINE_PINK, + COLOR_DEEP_CARROT_ORANGE, + COLOR_DEEP_CERISE, + COLOR_DEEP_CHAMPAGNE, + COLOR_DEEP_CHESTNUT, + COLOR_DEEP_COFFEE, + COLOR_DEEP_FUCHSIA, + COLOR_DEEP_JUNGLE_GREEN, + COLOR_DEEP_LILAC, + COLOR_DEEP_MAGENTA, + COLOR_DEEP_PEACH, + COLOR_DEEP_PINK, + COLOR_DEEP_RUBY, + COLOR_DEEP_SAFFRON, + COLOR_DEEP_SKY_BLUE, + COLOR_DEEP_TUSCAN_RED, + COLOR_DENIM, + COLOR_DESERT, + COLOR_DESERT_SAND, + COLOR_DIM_GRAY, + COLOR_DODGER_BLUE, + COLOR_DOGWOOD_ROSE, + COLOR_DOLLAR_BILL, + COLOR_DRAB, + COLOR_DUKE_BLUE, + COLOR_EARTH_YELLOW, + COLOR_EBONY, + COLOR_ECRU, + COLOR_EGGPLANT, + COLOR_EGGSHELL, + COLOR_EGYPTIAN_BLUE, + COLOR_ELECTRIC_BLUE, + COLOR_ELECTRIC_CRIMSON, + COLOR_ELECTRIC_CYAN, + COLOR_ELECTRIC_GREEN, + COLOR_ELECTRIC_INDIGO, + COLOR_ELECTRIC_LAVENDER, + COLOR_ELECTRIC_LIME, + COLOR_ELECTRIC_PURPLE, + COLOR_ELECTRIC_ULTRAMARINE, + COLOR_ELECTRIC_VIOLET, + COLOR_ELECTRIC_YELLOW, + COLOR_EMERALD, + COLOR_ENGLISH_LAVENDER, + COLOR_ETON_BLUE, + COLOR_FALLOW, + COLOR_FALU_RED, + COLOR_FANDANGO, + COLOR_FASHION_FUCHSIA, + COLOR_FAWN, + COLOR_FELDGRAU, + COLOR_FERN_GREEN, + COLOR_FERRARI_RED, + COLOR_FIELD_DRAB, + COLOR_FIRE_ENGINE_RED, + COLOR_FIREBRICK, + COLOR_FLAME, + COLOR_FLAMINGO_PINK, + COLOR_FLAVESCENT, + COLOR_FLAX, + COLOR_FLORAL_WHITE, + COLOR_FLUORESCENT_ORANGE, + COLOR_FLUORESCENT_PINK, + COLOR_FLUORESCENT_YELLOW, + COLOR_FOLLY, + COLOR_FOREST_GREEN_TRADITIONAL, + COLOR_FOREST_GREEN_WEB, + COLOR_FRENCH_BEIGE, + COLOR_FRENCH_BLUE, + COLOR_FRENCH_LILAC, + COLOR_FRENCH_LIME, + COLOR_FRENCH_RASPBERRY, + COLOR_FRENCH_ROSE, + COLOR_FUCHSIA, + COLOR_FUCHSIA_CRAYOLA, + COLOR_FUCHSIA_PINK, + COLOR_FUCHSIA_ROSE, + COLOR_FULVOUS, + COLOR_FUZZY_WUZZY, + COLOR_GAINSBORO, + COLOR_GAMBOGE, + COLOR_GHOST_WHITE, + COLOR_GINGER, + COLOR_GLAUCOUS, + COLOR_GLITTER, + COLOR_GOLD_METALLIC, + COLOR_GOLD_WEB_GOLDEN, + COLOR_GOLDEN_BROWN, + COLOR_GOLDEN_POPPY, + COLOR_GOLDEN_YELLOW, + COLOR_GOLDENROD, + COLOR_GRANNY_SMITH_APPLE, + COLOR_GRAY, + COLOR_GRAY_ASPARAGUS, + COLOR_GRAY_HTML_CSS_GRAY, + COLOR_GRAY_X11_GRAY, + COLOR_GREEN_COLOR_WHEEL_X11_GREEN, + COLOR_GREEN_CRAYOLA, + COLOR_GREEN_HTML_CSS_GREEN, + COLOR_GREEN_MUNSELL, + COLOR_GREEN_NCS, + COLOR_GREEN_PIGMENT, + COLOR_GREEN_RYB, + COLOR_GREEN_YELLOW, + COLOR_GRULLO, + COLOR_GUPPIE_GREEN, + COLOR_HALAY_BE, + COLOR_HAN_BLUE, + COLOR_HAN_PURPLE, + COLOR_HANSA_YELLOW, + COLOR_HARLEQUIN, + COLOR_HARVARD_CRIMSON, + COLOR_HARVEST_GOLD, + COLOR_HEART_GOLD, + COLOR_HELIOTROPE, + COLOR_HOLLYWOOD_CERISE, + COLOR_HONEYDEW, + COLOR_HONOLULU_BLUE, + COLOR_HOOKER_S_GREEN, + COLOR_HOT_MAGENTA, + COLOR_HOT_PINK, + COLOR_HUNTER_GREEN, + COLOR_ICEBERG, + COLOR_ICTERINE, + COLOR_IMPERIAL_BLUE, + COLOR_INCHWORM, + COLOR_INDIA_GREEN, + COLOR_INDIAN_RED, + COLOR_INDIAN_YELLOW, + COLOR_INDIGO, + COLOR_INDIGO_DYE, + COLOR_INDIGO_WEB, + COLOR_INTERNATIONAL_KLEIN_BLUE, + COLOR_INTERNATIONAL_ORANGE_AEROSPACE, + COLOR_INTERNATIONAL_ORANGE_ENGINEERING, + COLOR_INTERNATIONAL_ORANGE_GOLDEN_GATE_BRIDGE, + COLOR_IRIS, + COLOR_ISABELLINE, + COLOR_ISLAMIC_GREEN, + COLOR_IVORY, + COLOR_JADE, + COLOR_JASMINE, + COLOR_JASPER, + COLOR_JAZZBERRY_JAM, + COLOR_JET, + COLOR_JONQUIL, + COLOR_JUNE_BUD, + COLOR_JUNGLE_GREEN, + COLOR_KELLY_GREEN, + COLOR_KENYAN_COPPER, + COLOR_KHAKI_HTML_CSS_KHAKI, + COLOR_KHAKI_X11_LIGHT_KHAKI, + COLOR_KU_CRIMSON, + COLOR_LA_SALLE_GREEN, + COLOR_LANGUID_LAVENDER, + COLOR_LAPIS_LAZULI, + COLOR_LASER_LEMON, + COLOR_LAUREL_GREEN, + COLOR_LAVA, + COLOR_LAVENDER_BLUE, + COLOR_LAVENDER_BLUSH, + COLOR_LAVENDER_FLORAL, + COLOR_LAVENDER_GRAY, + COLOR_LAVENDER_INDIGO, + COLOR_LAVENDER_MAGENTA, + COLOR_LAVENDER_MIST, + COLOR_LAVENDER_PINK, + COLOR_LAVENDER_PURPLE, + COLOR_LAVENDER_ROSE, + COLOR_LAVENDER_WEB, + COLOR_LAWN_GREEN, + COLOR_LEMON, + COLOR_LEMON_CHIFFON, + COLOR_LEMON_LIME, + COLOR_LICORICE, + COLOR_LIGHT_APRICOT, + COLOR_LIGHT_BLUE, + COLOR_LIGHT_BROWN, + COLOR_LIGHT_CARMINE_PINK, + COLOR_LIGHT_CORAL, + COLOR_LIGHT_CORNFLOWER_BLUE, + COLOR_LIGHT_CRIMSON, + COLOR_LIGHT_CYAN, + COLOR_LIGHT_FUCHSIA_PINK, + COLOR_LIGHT_GOLDENROD_YELLOW, + COLOR_LIGHT_GRAY, + COLOR_LIGHT_GREEN, + COLOR_LIGHT_KHAKI, + COLOR_LIGHT_PASTEL_PURPLE, + COLOR_LIGHT_PINK, + COLOR_LIGHT_RED_OCHRE, + COLOR_LIGHT_SALMON, + COLOR_LIGHT_SALMON_PINK, + COLOR_LIGHT_SEA_GREEN, + COLOR_LIGHT_SKY_BLUE, + COLOR_LIGHT_SLATE_GRAY, + COLOR_LIGHT_TAUPE, + COLOR_LIGHT_THULIAN_PINK, + COLOR_LIGHT_YELLOW, + COLOR_LILAC, + COLOR_LIME_COLOR_WHEEL, + COLOR_LIME_GREEN, + COLOR_LIME_WEB_X11_GREEN, + COLOR_LIMERICK, + COLOR_LINCOLN_GREEN, + COLOR_LINEN, + COLOR_LION, + COLOR_LITTLE_BOY_BLUE, + COLOR_LIVER, + COLOR_LUST, + COLOR_MAGENTA, + COLOR_MAGENTA_DYE, + COLOR_MAGENTA_PROCESS, + COLOR_MAGIC_MINT, + COLOR_MAGNOLIA, + COLOR_MAHOGANY, + COLOR_MAIZE, + COLOR_MAJORELLE_BLUE, + COLOR_MALACHITE, + COLOR_MANATEE, + COLOR_MANGO_TANGO, + COLOR_MANTIS, + COLOR_MARDI_GRAS, + COLOR_MAROON_CRAYOLA, + COLOR_MAROON_HTML_CSS, + COLOR_MAROON_X11, + COLOR_MAUVE, + COLOR_MAUVE_TAUPE, + COLOR_MAUVELOUS, + COLOR_MAYA_BLUE, + COLOR_MEAT_BROWN, + COLOR_MEDIUM_AQUAMARINE, + COLOR_MEDIUM_BLUE, + COLOR_MEDIUM_CANDY_APPLE_RED, + COLOR_MEDIUM_CARMINE, + COLOR_MEDIUM_CHAMPAGNE, + COLOR_MEDIUM_ELECTRIC_BLUE, + COLOR_MEDIUM_JUNGLE_GREEN, + COLOR_MEDIUM_LAVENDER_MAGENTA, + COLOR_MEDIUM_ORCHID, + COLOR_MEDIUM_PERSIAN_BLUE, + COLOR_MEDIUM_PURPLE, + COLOR_MEDIUM_RED_VIOLET, + COLOR_MEDIUM_RUBY, + COLOR_MEDIUM_SEA_GREEN, + COLOR_MEDIUM_SLATE_BLUE, + COLOR_MEDIUM_SPRING_BUD, + COLOR_MEDIUM_SPRING_GREEN, + COLOR_MEDIUM_TAUPE, + COLOR_MEDIUM_TURQUOISE, + COLOR_MEDIUM_TUSCAN_RED, + COLOR_MEDIUM_VERMILION, + COLOR_MEDIUM_VIOLET_RED, + COLOR_MELLOW_APRICOT, + COLOR_MELLOW_YELLOW, + COLOR_MELON, + COLOR_MIDNIGHT_BLUE, + COLOR_MIDNIGHT_GREEN_EAGLE_GREEN, + COLOR_MIKADO_YELLOW, + COLOR_MINT, + COLOR_MINT_CREAM, + COLOR_MINT_GREEN, + COLOR_MISTY_ROSE, + COLOR_MOCCASIN, + COLOR_MODE_BEIGE, + COLOR_MOONSTONE_BLUE, + COLOR_MORDANT_RED_19, + COLOR_MOSS_GREEN, + COLOR_MOUNTAIN_MEADOW, + COLOR_MOUNTBATTEN_PINK, + COLOR_MSU_GREEN, + COLOR_MULBERRY, + COLOR_MUSTARD, + COLOR_MYRTLE, + COLOR_NADESHIKO_PINK, + COLOR_NAPIER_GREEN, + COLOR_NAPLES_YELLOW, + COLOR_NAVAJO_WHITE, + COLOR_NAVY_BLUE, + COLOR_NEON_CARROT, + COLOR_NEON_FUCHSIA, + COLOR_NEON_GREEN, + COLOR_NEW_YORK_PINK, + COLOR_NON_PHOTO_BLUE, + COLOR_NORTH_TEXAS_GREEN, + COLOR_OCEAN_BOAT_BLUE, + COLOR_OCHRE, + COLOR_OFFICE_GREEN, + COLOR_OLD_GOLD, + COLOR_OLD_LACE, + COLOR_OLD_LAVENDER, + COLOR_OLD_MAUVE, + COLOR_OLD_ROSE, + COLOR_OLIVE, + COLOR_OLIVE_DRAB_7, + COLOR_OLIVE_DRAB_WEB_OLIVE_DRAB_3, + COLOR_OLIVINE, + COLOR_ONYX, + COLOR_OPERA_MAUVE, + COLOR_ORANGE_COLOR_WHEEL, + COLOR_ORANGE_PEEL, + COLOR_ORANGE_RED, + COLOR_ORANGE_RYB, + COLOR_ORANGE_WEB_COLOR, + COLOR_ORCHID, + COLOR_OTTER_BROWN, + COLOR_OU_CRIMSON_RED, + COLOR_OUTER_SPACE, + COLOR_OUTRAGEOUS_ORANGE, + COLOR_OXFORD_BLUE, + COLOR_PAKISTAN_GREEN, + COLOR_PALATINATE_BLUE, + COLOR_PALATINATE_PURPLE, + COLOR_PALE_AQUA, + COLOR_PALE_BLUE, + COLOR_PALE_BROWN, + COLOR_PALE_CARMINE, + COLOR_PALE_CERULEAN, + COLOR_PALE_CHESTNUT, + COLOR_PALE_COPPER, + COLOR_PALE_CORNFLOWER_BLUE, + COLOR_PALE_GOLD, + COLOR_PALE_GOLDENROD, + COLOR_PALE_GREEN, + COLOR_PALE_LAVENDER, + COLOR_PALE_MAGENTA, + COLOR_PALE_PINK, + COLOR_PALE_PLUM, + COLOR_PALE_RED_VIOLET, + COLOR_PALE_ROBIN_EGG_BLUE, + COLOR_PALE_SILVER, + COLOR_PALE_SPRING_BUD, + COLOR_PALE_TAUPE, + COLOR_PALE_VIOLET_RED, + COLOR_PANSY_PURPLE, + COLOR_PAPAYA_WHIP, + COLOR_PARIS_GREEN, + COLOR_PASTEL_BLUE, + COLOR_PASTEL_BROWN, + COLOR_PASTEL_GRAY, + COLOR_PASTEL_GREEN, + COLOR_PASTEL_MAGENTA, + COLOR_PASTEL_ORANGE, + COLOR_PASTEL_PINK, + COLOR_PASTEL_PURPLE, + COLOR_PASTEL_RED, + COLOR_PASTEL_VIOLET, + COLOR_PASTEL_YELLOW, + COLOR_PATRIARCH, + COLOR_PAYNE_S_GREY, + COLOR_PEACH, + COLOR_PEACH_CRAYOLA, + COLOR_PEACH_ORANGE, + COLOR_PEACH_PUFF, + COLOR_PEACH_YELLOW, + COLOR_PEAR, + COLOR_PEARL, + COLOR_PEARL_AQUA, + COLOR_PEARLY_PURPLE, + COLOR_PERIDOT, + COLOR_PERIWINKLE, + COLOR_PERSIAN_BLUE, + COLOR_PERSIAN_GREEN, + COLOR_PERSIAN_INDIGO, + COLOR_PERSIAN_ORANGE, + COLOR_PERSIAN_PINK, + COLOR_PERSIAN_PLUM, + COLOR_PERSIAN_RED, + COLOR_PERSIAN_ROSE, + COLOR_PERSIMMON, + COLOR_PERU, + COLOR_PHLOX, + COLOR_PHTHALO_BLUE, + COLOR_PHTHALO_GREEN, + COLOR_PIGGY_PINK, + COLOR_PINE_GREEN, + COLOR_PINK, + COLOR_PINK_LACE, + COLOR_PINK_ORANGE, + COLOR_PINK_PEARL, + COLOR_PINK_SHERBET, + COLOR_PISTACHIO, + COLOR_PLATINUM, + COLOR_PLUM_TRADITIONAL, + COLOR_PLUM_WEB, + COLOR_PORTLAND_ORANGE, + COLOR_POWDER_BLUE_WEB, + COLOR_PRINCETON_ORANGE, + COLOR_PRUNE, + COLOR_PRUSSIAN_BLUE, + COLOR_PSYCHEDELIC_PURPLE, + COLOR_PUCE, + COLOR_PUMPKIN, + COLOR_PURPLE_HEART, + COLOR_PURPLE_HTML_CSS, + COLOR_PURPLE_MOUNTAIN_MAJESTY, + COLOR_PURPLE_MUNSELL, + COLOR_PURPLE_PIZZAZZ, + COLOR_PURPLE_TAUPE, + COLOR_PURPLE_X11, + COLOR_QUARTZ, + COLOR_RACKLEY, + COLOR_RADICAL_RED, + COLOR_RAJAH, + COLOR_RASPBERRY, + COLOR_RASPBERRY_GLACE, + COLOR_RASPBERRY_PINK, + COLOR_RASPBERRY_ROSE, + COLOR_RAW_UMBER, + COLOR_RAZZLE_DAZZLE_ROSE, + COLOR_RAZZMATAZZ, + COLOR_RED, + COLOR_RED_BROWN, + COLOR_RED_DEVIL, + COLOR_RED_MUNSELL, + COLOR_RED_NCS, + COLOR_RED_ORANGE, + COLOR_RED_PIGMENT, + COLOR_RED_RYB, + COLOR_RED_VIOLET, + COLOR_REDWOOD, + COLOR_REGALIA, + COLOR_RESOLUTION_BLUE, + COLOR_RICH_BLACK, + COLOR_RICH_BRILLIANT_LAVENDER, + COLOR_RICH_CARMINE, + COLOR_RICH_ELECTRIC_BLUE, + COLOR_RICH_LAVENDER, + COLOR_RICH_LILAC, + COLOR_RICH_MAROON, + COLOR_RIFLE_GREEN, + COLOR_ROBIN_EGG_BLUE, + COLOR_ROSE, + COLOR_ROSE_BONBON, + COLOR_ROSE_EBONY, + COLOR_ROSE_GOLD, + COLOR_ROSE_MADDER, + COLOR_ROSE_PINK, + COLOR_ROSE_QUARTZ, + COLOR_ROSE_TAUPE, + COLOR_ROSE_VALE, + COLOR_ROSEWOOD, + COLOR_ROSSO_CORSA, + COLOR_ROSY_BROWN, + COLOR_ROYAL_AZURE, + COLOR_ROYAL_BLUE_TRADITIONAL, + COLOR_ROYAL_BLUE_WEB, + COLOR_ROYAL_FUCHSIA, + COLOR_ROYAL_PURPLE, + COLOR_ROYAL_YELLOW, + COLOR_RUBINE_RED, + COLOR_RUBY, + COLOR_RUBY_RED, + COLOR_RUDDY, + COLOR_RUDDY_BROWN, + COLOR_RUDDY_PINK, + COLOR_RUFOUS, + COLOR_RUSSET, + COLOR_RUST, + COLOR_RUSTY_RED, + COLOR_SACRAMENTO_STATE_GREEN, + COLOR_SADDLE_BROWN, + COLOR_SAFETY_ORANGE_BLAZE_ORANGE, + COLOR_SAFFRON, + COLOR_SALMON, + COLOR_SALMON_PINK, + COLOR_SAND, + COLOR_SAND_DUNE, + COLOR_SANDSTORM, + COLOR_SANDY_BROWN, + COLOR_SANDY_TAUPE, + COLOR_SANGRIA, + COLOR_SAP_GREEN, + COLOR_SAPPHIRE, + COLOR_SAPPHIRE_BLUE, + COLOR_SATIN_SHEEN_GOLD, + COLOR_SCARLET, + COLOR_SCARLET_CRAYOLA, + COLOR_SCHOOL_BUS_YELLOW, + COLOR_SCREAMIN_GREEN, + COLOR_SEA_BLUE, + COLOR_SEA_GREEN, + COLOR_SEAL_BROWN, + COLOR_SEASHELL, + COLOR_SELECTIVE_YELLOW, + COLOR_SEPIA, + COLOR_SHADOW, + COLOR_SHAMROCK_GREEN, + COLOR_SHOCKING_PINK, + COLOR_SHOCKING_PINK_CRAYOLA, + COLOR_SIENNA, + COLOR_SILVER, + COLOR_SINOPIA, + COLOR_SKOBELOFF, + COLOR_SKY_BLUE, + COLOR_SKY_MAGENTA, + COLOR_SLATE_BLUE, + COLOR_SLATE_GRAY, + COLOR_SMALT_DARK_POWDER_BLUE, + COLOR_SMOKEY_TOPAZ, + COLOR_SMOKY_BLACK, + COLOR_SNOW, + COLOR_SPIRO_DISCO_BALL, + COLOR_SPRING_BUD, + COLOR_SPRING_GREEN, + COLOR_ST_PATRICK_S_BLUE, + COLOR_STEEL_BLUE, + COLOR_STIL_DE_GRAIN_YELLOW, + COLOR_STIZZA, + COLOR_STORMCLOUD, + COLOR_STRAW, + COLOR_SUNGLOW, + COLOR_SUNSET, + COLOR_TAN, + COLOR_TANGELO, + COLOR_TANGERINE, + COLOR_TANGERINE_YELLOW, + COLOR_TANGO_PINK, + COLOR_TAUPE, + COLOR_TAUPE_GRAY, + COLOR_TEA_GREEN, + COLOR_TEA_ROSE_ORANGE, + COLOR_TEA_ROSE_ROSE, + COLOR_TEAL, + COLOR_TEAL_BLUE, + COLOR_TEAL_GREEN, + COLOR_TELEMAGENTA, + COLOR_TENN_TAWNY, + COLOR_TERRA_COTTA, + COLOR_THISTLE, + COLOR_THULIAN_PINK, + COLOR_TICKLE_ME_PINK, + COLOR_TIFFANY_BLUE, + COLOR_TIGER_S_EYE, + COLOR_TIMBERWOLF, + COLOR_TITANIUM_YELLOW, + COLOR_TOMATO, + COLOR_TOOLBOX, + COLOR_TOPAZ, + COLOR_TRACTOR_RED, + COLOR_TROLLEY_GREY, + COLOR_TROPICAL_RAIN_FOREST, + COLOR_TRUE_BLUE, + COLOR_TUFTS_BLUE, + COLOR_TUMBLEWEED, + COLOR_TURKISH_ROSE, + COLOR_TURQUOISE, + COLOR_TURQUOISE_BLUE, + COLOR_TURQUOISE_GREEN, + COLOR_TUSCAN_RED, + COLOR_TWILIGHT_LAVENDER, + COLOR_TYRIAN_PURPLE, + COLOR_UA_BLUE, + COLOR_UA_RED, + COLOR_UBE, + COLOR_UCLA_BLUE, + COLOR_UCLA_GOLD, + COLOR_UFO_GREEN, + COLOR_ULTRA_PINK, + COLOR_ULTRAMARINE, + COLOR_ULTRAMARINE_BLUE, + COLOR_UMBER, + COLOR_UNBLEACHED_SILK, + COLOR_UNITED_NATIONS_BLUE, + COLOR_UNIVERSITY_OF_CALIFORNIA_GOLD, + COLOR_UNMELLOW_YELLOW, + COLOR_UP_FOREST_GREEN, + COLOR_UP_MAROON, + COLOR_UPSDELL_RED, + COLOR_UROBILIN, + COLOR_USAFA_BLUE, + COLOR_USC_CARDINAL, + COLOR_USC_GOLD, + COLOR_UTAH_CRIMSON, + COLOR_VANILLA, + COLOR_VEGAS_GOLD, + COLOR_VENETIAN_RED, + COLOR_VERDIGRIS, + COLOR_VERMILION_CINNABAR, + COLOR_VERMILION_PLOCHERE, + COLOR_VERONICA, + COLOR_VIOLET, + COLOR_VIOLET_BLUE, + COLOR_VIOLET_COLOR_WHEEL, + COLOR_VIOLET_RYB, + COLOR_VIOLET_WEB, + COLOR_VIRIDIAN, + COLOR_VIVID_AUBURN, + COLOR_VIVID_BURGUNDY, + COLOR_VIVID_CERISE, + COLOR_VIVID_TANGERINE, + COLOR_VIVID_VIOLET, + COLOR_WARM_BLACK, + COLOR_WATERSPOUT, + COLOR_WENGE, + COLOR_WHEAT, + COLOR_WHITE, + COLOR_WHITE_SMOKE, + COLOR_WILD_BLUE_YONDER, + COLOR_WILD_STRAWBERRY, + COLOR_WILD_WATERMELON, + COLOR_WINE, + COLOR_WINE_DREGS, + COLOR_WISTERIA, + COLOR_WOOD_BROWN, + COLOR_XANADU, + COLOR_YALE_BLUE, + COLOR_YELLOW, + COLOR_YELLOW_GREEN, + COLOR_YELLOW_MUNSELL, + COLOR_YELLOW_NCS, + COLOR_YELLOW_ORANGE, + COLOR_YELLOW_PROCESS, + COLOR_YELLOW_RYB, + COLOR_ZAFFRE, + COLOR_ZINNWALDITE_BROWN, + KULOR_SUNSET_CAMPING1, + KULOR_SUNSET_CAMPING2, + KULOR_SUNSET_CAMPING3, + KULOR_SUNSET_CAMPING4, + KULOR_SUNSET_CAMPING5, + KULOR_YELLOW_SHADES1, + KULOR_YELLOW_SHADES2, + KULOR_YELLOW_SHADES3, + KULOR_YELLOW_SHADES4, + KULOR_YELLOW_SHADES5, + NUMBER_OF_COLORS +} Color; + + + + +const ColorInfo color_data[NUMBER_OF_COLORS] = { + { "Air Force Blue (Raf)", "#5d8aa8", { 93, 138, 168 } }, + { "Air Force Blue (Usaf)", "#00308f", { 0, 48, 143 } }, + { "Air Superiority Blue", "#72a0c1", { 114, 160, 193 } }, + { "Alabama Crimson", "#a32638", { 163, 38, 56 } }, + { "Alice Blue", "#f0f8ff", { 240, 248, 255 } }, + { "Alizarin Crimson", "#e32636", { 227, 38, 54 } }, + { "Alloy Orange", "#c46210", { 196, 98, 16 } }, + { "Almond", "#efdecd", { 239, 222, 205 } }, + { "Amaranth", "#e52b50", { 229, 43, 80 } }, + { "Amber", "#ffbf00", { 255, 191, 0 } }, + { "Amber (Sae/Ece)", "#ff7e00", { 255, 126, 0 } }, + { "American Rose", "#ff033e", { 255, 3, 62 } }, + { "Amethyst", "#96c", { 153, 102, 204 } }, + { "Android Green", "#a4c639", { 164, 198, 57 } }, + { "Anti-Flash White", "#f2f3f4", { 242, 243, 244 } }, + { "Antique Brass", "#cd9575", { 205, 149, 117 } }, + { "Antique Fuchsia", "#915c83", { 145, 92, 131 } }, + { "Antique Ruby", "#841b2d", { 132, 27, 45 } }, + { "Antique White", "#faebd7", { 250, 235, 215 } }, + { "Ao (English)", "#008000", { 0, 128, 0 } }, + { "Apple Green", "#8db600", { 141, 182, 0 } }, + { "Apricot", "#fbceb1", { 251, 206, 177 } }, + { "Aqua", "#0ff", { 0, 255, 255 } }, + { "Aquamarine", "#7fffd4", { 127, 255, 212 } }, + { "Army Green", "#4b5320", { 75, 83, 32 } }, + { "Arsenic", "#3b444b", { 59, 68, 75 } }, + { "Arylide Yellow", "#e9d66b", { 233, 214, 107 } }, + { "Ash Grey", "#b2beb5", { 178, 190, 181 } }, + { "Asparagus", "#87a96b", { 135, 169, 107 } }, + { "Atomic Tangerine", "#f96", { 255, 153, 102 } }, + { "Auburn", "#a52a2a", { 165, 42, 42 } }, + { "Aureolin", "#fdee00", { 253, 238, 0 } }, + { "Aurometalsaurus", "#6e7f80", { 110, 127, 128 } }, + { "Avocado", "#568203", { 86, 130, 3 } }, + { "Azure", "#007fff", { 0, 127, 255 } }, + { "Azure Mist/Web", "#f0ffff", { 240, 255, 255 } }, + { "Baby Blue", "#89cff0", { 137, 207, 240 } }, + { "Baby Blue Eyes", "#a1caf1", { 161, 202, 241 } }, + { "Baby Pink", "#f4c2c2", { 244, 194, 194 } }, + { "Ball Blue", "#21abcd", { 33, 171, 205 } }, + { "Banana Mania", "#fae7b5", { 250, 231, 181 } }, + { "Banana Yellow", "#ffe135", { 255, 225, 53 } }, + { "Barn Red", "#7c0a02", { 124, 10, 2 } }, + { "Battleship Grey", "#848482", { 132, 132, 130 } }, + { "Bazaar", "#98777b", { 152, 119, 123 } }, + { "Beau Blue", "#bcd4e6", { 188, 212, 230 } }, + { "Beaver", "#9f8170", { 159, 129, 112 } }, + { "Beige", "#f5f5dc", { 245, 245, 220 } }, + { "Big Dip O Ruby", "#9c2542", { 156, 37, 66 } }, + { "Bisque", "#ffe4c4", { 255, 228, 196 } }, + { "Bistre", "#3d2b1f", { 61, 43, 31 } }, + { "Bittersweet", "#fe6f5e", { 254, 111, 94 } }, + { "Bittersweet Shimmer", "#bf4f51", { 191, 79, 81 } }, + { "Black", "#000", { 0, 0, 0 } }, + { "Black Bean", "#3d0c02", { 61, 12, 2 } }, + { "Black Leather Jacket", "#253529", { 37, 53, 41 } }, + { "Black Olive", "#3b3c36", { 59, 60, 54 } }, + { "Blanched Almond", "#ffebcd", { 255, 235, 205 } }, + { "Blast-Off Bronze", "#a57164", { 165, 113, 100 } }, + { "Bleu De France", "#318ce7", { 49, 140, 231 } }, + { "Blizzard Blue", "#ace5ee", { 172, 229, 238 } }, + { "Blond", "#faf0be", { 250, 240, 190 } }, + { "Blue", "#00f", { 0, 0, 255 } }, + { "Blue Bell", "#a2a2d0", { 162, 162, 208 } }, + { "Blue (Crayola)", "#1f75fe", { 31, 117, 254 } }, + { "Blue Gray", "#69c", { 102, 153, 204 } }, + { "Blue-Green", "#0d98ba", { 13, 152, 186 } }, + { "Blue (Munsell)", "#0093af", { 0, 147, 175 } }, + { "Blue (Ncs)", "#0087bd", { 0, 135, 189 } }, + { "Blue (Pigment)", "#339", { 51, 51, 153 } }, + { "Blue (Ryb)", "#0247fe", { 2, 71, 254 } }, + { "Blue Sapphire", "#126180", { 18, 97, 128 } }, + { "Blue-Violet", "#8a2be2", { 138, 43, 226 } }, + { "Blush", "#de5d83", { 222, 93, 131 } }, + { "Bole", "#79443b", { 121, 68, 59 } }, + { "Bondi Blue", "#0095b6", { 0, 149, 182 } }, + { "Bone", "#e3dac9", { 227, 218, 201 } }, + { "Boston University Red", "#c00", { 204, 0, 0 } }, + { "Bottle Green", "#006a4e", { 0, 106, 78 } }, + { "Boysenberry", "#873260", { 135, 50, 96 } }, + { "Brandeis Blue", "#0070ff", { 0, 112, 255 } }, + { "Brass", "#b5a642", { 181, 166, 66 } }, + { "Brick Red", "#cb4154", { 203, 65, 84 } }, + { "Bright Cerulean", "#1dacd6", { 29, 172, 214 } }, + { "Bright Green", "#6f0", { 102, 255, 0 } }, + { "Bright Lavender", "#bf94e4", { 191, 148, 228 } }, + { "Bright Maroon", "#c32148", { 195, 33, 72 } }, + { "Bright Pink", "#ff007f", { 255, 0, 127 } }, + { "Bright Turquoise", "#08e8de", { 8, 232, 222 } }, + { "Bright Ube", "#d19fe8", { 209, 159, 232 } }, + { "Brilliant Lavender", "#f4bbff", { 244, 187, 255 } }, + { "Brilliant Rose", "#ff55a3", { 255, 85, 163 } }, + { "Brink Pink", "#fb607f", { 251, 96, 127 } }, + { "British Racing Green", "#004225", { 0, 66, 37 } }, + { "Bronze", "#cd7f32", { 205, 127, 50 } }, + { "Brown (Traditional)", "#964b00", { 150, 75, 0 } }, + { "Brown (Web)", "#a52a2a", { 165, 42, 42 } }, + { "Bubble Gum", "#ffc1cc", { 255, 193, 204 } }, + { "Bubbles", "#e7feff", { 231, 254, 255 } }, + { "Buff", "#f0dc82", { 240, 220, 130 } }, + { "Bulgarian Rose", "#480607", { 72, 6, 7 } }, + { "Burgundy", "#800020", { 128, 0, 32 } }, + { "Burlywood", "#deb887", { 222, 184, 135 } }, + { "Burnt Orange", "#c50", { 204, 85, 0 } }, + { "Burnt Sienna", "#e97451", { 233, 116, 81 } }, + { "Burnt Umber", "#8a3324", { 138, 51, 36 } }, + { "Byzantine", "#bd33a4", { 189, 51, 164 } }, + { "Byzantium", "#702963", { 112, 41, 99 } }, + { "Cadet", "#536872", { 83, 104, 114 } }, + { "Cadet Blue", "#5f9ea0", { 95, 158, 160 } }, + { "Cadet Grey", "#91a3b0", { 145, 163, 176 } }, + { "Cadmium Green", "#006b3c", { 0, 107, 60 } }, + { "Cadmium Orange", "#ed872d", { 237, 135, 45 } }, + { "Cadmium Red", "#e30022", { 227, 0, 34 } }, + { "Cadmium Yellow", "#fff600", { 255, 246, 0 } }, + { "Cafe Au Lait", "#a67b5b", { 166, 123, 91 } }, + { "Cafe Noir", "#4b3621", { 75, 54, 33 } }, + { "Cal Poly Green", "#1e4d2b", { 30, 77, 43 } }, + { "Cambridge Blue", "#a3c1ad", { 163, 193, 173 } }, + { "Camel", "#c19a6b", { 193, 154, 107 } }, + { "Cameo Pink", "#efbbcc", { 239, 187, 204 } }, + { "Camouflage Green", "#78866b", { 120, 134, 107 } }, + { "Canary Yellow", "#ffef00", { 255, 239, 0 } }, + { "Candy Apple Red", "#ff0800", { 255, 8, 0 } }, + { "Candy Pink", "#e4717a", { 228, 113, 122 } }, + { "Capri", "#00bfff", { 0, 191, 255 } }, + { "Caput Mortuum", "#592720", { 89, 39, 32 } }, + { "Cardinal", "#c41e3a", { 196, 30, 58 } }, + { "Caribbean Green", "#0c9", { 0, 204, 153 } }, + { "Carmine", "#960018", { 150, 0, 24 } }, + { "Carmine (M&P)", "#d70040", { 215, 0, 64 } }, + { "Carmine Pink", "#eb4c42", { 235, 76, 66 } }, + { "Carmine Red", "#ff0038", { 255, 0, 56 } }, + { "Carnation Pink", "#ffa6c9", { 255, 166, 201 } }, + { "Carnelian", "#b31b1b", { 179, 27, 27 } }, + { "Carolina Blue", "#99badd", { 153, 186, 221 } }, + { "Carrot Orange", "#ed9121", { 237, 145, 33 } }, + { "Catalina Blue", "#062a78", { 6, 42, 120 } }, + { "Ceil", "#92a1cf", { 146, 161, 207 } }, + { "Celadon", "#ace1af", { 172, 225, 175 } }, + { "Celadon Blue", "#007ba7", { 0, 123, 167 } }, + { "Celadon Green", "#2f847c", { 47, 132, 124 } }, + { "Celeste (Colour)", "#b2ffff", { 178, 255, 255 } }, + { "Celestial Blue", "#4997d0", { 73, 151, 208 } }, + { "Cerise", "#de3163", { 222, 49, 99 } }, + { "Cerise Pink", "#ec3b83", { 236, 59, 131 } }, + { "Cerulean", "#007ba7", { 0, 123, 167 } }, + { "Cerulean Blue", "#2a52be", { 42, 82, 190 } }, + { "Cerulean Frost", "#6d9bc3", { 109, 155, 195 } }, + { "Cg Blue", "#007aa5", { 0, 122, 165 } }, + { "Cg Red", "#e03c31", { 224, 60, 49 } }, + { "Chamoisee", "#a0785a", { 160, 120, 90 } }, + { "Champagne", "#fad6a5", { 250, 214, 165 } }, + { "Charcoal", "#36454f", { 54, 69, 79 } }, + { "Charm Pink", "#e68fac", { 230, 143, 172 } }, + { "Chartreuse (Traditional)", "#dfff00", { 223, 255, 0 } }, + { "Chartreuse (Web)", "#7fff00", { 127, 255, 0 } }, + { "Cherry", "#de3163", { 222, 49, 99 } }, + { "Cherry Blossom Pink", "#ffb7c5", { 255, 183, 197 } }, + { "Chestnut", "#cd5c5c", { 205, 92, 92 } }, + { "China Pink", "#de6fa1", { 222, 111, 161 } }, + { "China Rose", "#a8516e", { 168, 81, 110 } }, + { "Chinese Red", "#aa381e", { 170, 56, 30 } }, + { "Chocolate (Traditional)", "#7b3f00", { 123, 63, 0 } }, + { "Chocolate (Web)", "#d2691e", { 210, 105, 30 } }, + { "Chrome Yellow", "#ffa700", { 255, 167, 0 } }, + { "Cinereous", "#98817b", { 152, 129, 123 } }, + { "Cinnabar", "#e34234", { 227, 66, 52 } }, + { "Cinnamon", "#d2691e", { 210, 105, 30 } }, + { "Citrine", "#e4d00a", { 228, 208, 10 } }, + { "Classic Rose", "#fbcce7", { 251, 204, 231 } }, + { "Cobalt", "#0047ab", { 0, 71, 171 } }, + { "Cocoa Brown", "#d2691e", { 210, 105, 30 } }, + { "Coffee", "#6f4e37", { 111, 78, 55 } }, + { "Columbia Blue", "#9bddff", { 155, 221, 255 } }, + { "Congo Pink", "#f88379", { 248, 131, 121 } }, + { "Cool Black", "#002e63", { 0, 46, 99 } }, + { "Cool Grey", "#8c92ac", { 140, 146, 172 } }, + { "Copper", "#b87333", { 184, 115, 51 } }, + { "Copper (Crayola)", "#da8a67", { 218, 138, 103 } }, + { "Copper Penny", "#ad6f69", { 173, 111, 105 } }, + { "Copper Red", "#cb6d51", { 203, 109, 81 } }, + { "Copper Rose", "#966", { 153, 102, 102 } }, + { "Coquelicot", "#ff3800", { 255, 56, 0 } }, + { "Coral", "#ff7f50", { 255, 127, 80 } }, + { "Coral Pink", "#f88379", { 248, 131, 121 } }, + { "Coral Red", "#ff4040", { 255, 64, 64 } }, + { "Cordovan", "#893f45", { 137, 63, 69 } }, + { "Corn", "#fbec5d", { 251, 236, 93 } }, + { "Cornell Red", "#b31b1b", { 179, 27, 27 } }, + { "Cornflower Blue", "#6495ed", { 100, 149, 237 } }, + { "Cornsilk", "#fff8dc", { 255, 248, 220 } }, + { "Cosmic Latte", "#fff8e7", { 255, 248, 231 } }, + { "Cotton Candy", "#ffbcd9", { 255, 188, 217 } }, + { "Cream", "#fffdd0", { 255, 253, 208 } }, + { "Crimson", "#dc143c", { 220, 20, 60 } }, + { "Crimson Glory", "#be0032", { 190, 0, 50 } }, + { "Cyan", "#0ff", { 0, 255, 255 } }, + { "Cyan (Process)", "#00b7eb", { 0, 183, 235 } }, + { "Daffodil", "#ffff31", { 255, 255, 49 } }, + { "Dandelion", "#f0e130", { 240, 225, 48 } }, + { "Dark Blue", "#00008b", { 0, 0, 139 } }, + { "Dark Brown", "#654321", { 101, 67, 33 } }, + { "Dark Byzantium", "#5d3954", { 93, 57, 84 } }, + { "Dark Candy Apple Red", "#a40000", { 164, 0, 0 } }, + { "Dark Cerulean", "#08457e", { 8, 69, 126 } }, + { "Dark Chestnut", "#986960", { 152, 105, 96 } }, + { "Dark Coral", "#cd5b45", { 205, 91, 69 } }, + { "Dark Cyan", "#008b8b", { 0, 139, 139 } }, + { "Dark Electric Blue", "#536878", { 83, 104, 120 } }, + { "Dark Goldenrod", "#b8860b", { 184, 134, 11 } }, + { "Dark Gray", "#a9a9a9", { 169, 169, 169 } }, + { "Dark Green", "#013220", { 1, 50, 32 } }, + { "Dark Imperial Blue", "#00416a", { 0, 65, 106 } }, + { "Dark Jungle Green", "#1a2421", { 26, 36, 33 } }, + { "Dark Khaki", "#bdb76b", { 189, 183, 107 } }, + { "Dark Lava", "#483c32", { 72, 60, 50 } }, + { "Dark Lavender", "#734f96", { 115, 79, 150 } }, + { "Dark Magenta", "#8b008b", { 139, 0, 139 } }, + { "Dark Midnight Blue", "#036", { 0, 51, 102 } }, + { "Dark Olive Green", "#556b2f", { 85, 107, 47 } }, + { "Dark Orange", "#ff8c00", { 255, 140, 0 } }, + { "Dark Orchid", "#9932cc", { 153, 50, 204 } }, + { "Dark Pastel Blue", "#779ecb", { 119, 158, 203 } }, + { "Dark Pastel Green", "#03c03c", { 3, 192, 60 } }, + { "Dark Pastel Purple", "#966fd6", { 150, 111, 214 } }, + { "Dark Pastel Red", "#c23b22", { 194, 59, 34 } }, + { "Dark Pink", "#e75480", { 231, 84, 128 } }, + { "Dark Powder Blue", "#039", { 0, 51, 153 } }, + { "Dark Raspberry", "#872657", { 135, 38, 87 } }, + { "Dark Red", "#8b0000", { 139, 0, 0 } }, + { "Dark Salmon", "#e9967a", { 233, 150, 122 } }, + { "Dark Scarlet", "#560319", { 86, 3, 25 } }, + { "Dark Sea Green", "#8fbc8f", { 143, 188, 143 } }, + { "Dark Sienna", "#3c1414", { 60, 20, 20 } }, + { "Dark Slate Blue", "#483d8b", { 72, 61, 139 } }, + { "Dark Slate Gray", "#2f4f4f", { 47, 79, 79 } }, + { "Dark Spring Green", "#177245", { 23, 114, 69 } }, + { "Dark Tan", "#918151", { 145, 129, 81 } }, + { "Dark Tangerine", "#ffa812", { 255, 168, 18 } }, + { "Dark Taupe", "#483c32", { 72, 60, 50 } }, + { "Dark Terra Cotta", "#cc4e5c", { 204, 78, 92 } }, + { "Dark Turquoise", "#00ced1", { 0, 206, 209 } }, + { "Dark Violet", "#9400d3", { 148, 0, 211 } }, + { "Dark Yellow", "#9b870c", { 155, 135, 12 } }, + { "Dartmouth Green", "#00703c", { 0, 112, 60 } }, + { "Davy'S Grey", "#555", { 85, 85, 85 } }, + { "Debian Red", "#d70a53", { 215, 10, 83 } }, + { "Deep Carmine", "#a9203e", { 169, 32, 62 } }, + { "Deep Carmine Pink", "#ef3038", { 239, 48, 56 } }, + { "Deep Carrot Orange", "#e9692c", { 233, 105, 44 } }, + { "Deep Cerise", "#da3287", { 218, 50, 135 } }, + { "Deep Champagne", "#fad6a5", { 250, 214, 165 } }, + { "Deep Chestnut", "#b94e48", { 185, 78, 72 } }, + { "Deep Coffee", "#704241", { 112, 66, 65 } }, + { "Deep Fuchsia", "#c154c1", { 193, 84, 193 } }, + { "Deep Jungle Green", "#004b49", { 0, 75, 73 } }, + { "Deep Lilac", "#95b", { 153, 85, 187 } }, + { "Deep Magenta", "#c0c", { 204, 0, 204 } }, + { "Deep Peach", "#ffcba4", { 255, 203, 164 } }, + { "Deep Pink", "#ff1493", { 255, 20, 147 } }, + { "Deep Ruby", "#843f5b", { 132, 63, 91 } }, + { "Deep Saffron", "#f93", { 255, 153, 51 } }, + { "Deep Sky Blue", "#00bfff", { 0, 191, 255 } }, + { "Deep Tuscan Red", "#66424d", { 102, 66, 77 } }, + { "Denim", "#1560bd", { 21, 96, 189 } }, + { "Desert", "#c19a6b", { 193, 154, 107 } }, + { "Desert Sand", "#edc9af", { 237, 201, 175 } }, + { "Dim Gray", "#696969", { 105, 105, 105 } }, + { "Dodger Blue", "#1e90ff", { 30, 144, 255 } }, + { "Dogwood Rose", "#d71868", { 215, 24, 104 } }, + { "Dollar Bill", "#85bb65", { 133, 187, 101 } }, + { "Drab", "#967117", { 150, 113, 23 } }, + { "Duke Blue", "#00009c", { 0, 0, 156 } }, + { "Earth Yellow", "#e1a95f", { 225, 169, 95 } }, + { "Ebony", "#555d50", { 85, 93, 80 } }, + { "Ecru", "#c2b280", { 194, 178, 128 } }, + { "Eggplant", "#614051", { 97, 64, 81 } }, + { "Eggshell", "#f0ead6", { 240, 234, 214 } }, + { "Egyptian Blue", "#1034a6", { 16, 52, 166 } }, + { "Electric Blue", "#7df9ff", { 125, 249, 255 } }, + { "Electric Crimson", "#ff003f", { 255, 0, 63 } }, + { "Electric Cyan", "#0ff", { 0, 255, 255 } }, + { "Electric Green", "#0f0", { 0, 255, 0 } }, + { "Electric Indigo", "#6f00ff", { 111, 0, 255 } }, + { "Electric Lavender", "#f4bbff", { 244, 187, 255 } }, + { "Electric Lime", "#cf0", { 204, 255, 0 } }, + { "Electric Purple", "#bf00ff", { 191, 0, 255 } }, + { "Electric Ultramarine", "#3f00ff", { 63, 0, 255 } }, + { "Electric Violet", "#8f00ff", { 143, 0, 255 } }, + { "Electric Yellow", "#ff0", { 255, 255, 0 } }, + { "Emerald", "#50c878", { 80, 200, 120 } }, + { "English Lavender", "#b48395", { 180, 131, 149 } }, + { "Eton Blue", "#96c8a2", { 150, 200, 162 } }, + { "Fallow", "#c19a6b", { 193, 154, 107 } }, + { "Falu Red", "#801818", { 128, 24, 24 } }, + { "Fandango", "#b53389", { 181, 51, 137 } }, + { "Fashion Fuchsia", "#f400a1", { 244, 0, 161 } }, + { "Fawn", "#e5aa70", { 229, 170, 112 } }, + { "Feldgrau", "#4d5d53", { 77, 93, 83 } }, + { "Fern Green", "#4f7942", { 79, 121, 66 } }, + { "Ferrari Red", "#ff2800", { 255, 40, 0 } }, + { "Field Drab", "#6c541e", { 108, 84, 30 } }, + { "Fire Engine Red", "#ce2029", { 206, 32, 41 } }, + { "Firebrick", "#b22222", { 178, 34, 34 } }, + { "Flame", "#e25822", { 226, 88, 34 } }, + { "Flamingo Pink", "#fc8eac", { 252, 142, 172 } }, + { "Flavescent", "#f7e98e", { 247, 233, 142 } }, + { "Flax", "#eedc82", { 238, 220, 130 } }, + { "Floral White", "#fffaf0", { 255, 250, 240 } }, + { "Fluorescent Orange", "#ffbf00", { 255, 191, 0 } }, + { "Fluorescent Pink", "#ff1493", { 255, 20, 147 } }, + { "Fluorescent Yellow", "#cf0", { 204, 255, 0 } }, + { "Folly", "#ff004f", { 255, 0, 79 } }, + { "Forest Green (Traditional)", "#014421", { 1, 68, 33 } }, + { "Forest Green (Web)", "#228b22", { 34, 139, 34 } }, + { "French Beige", "#a67b5b", { 166, 123, 91 } }, + { "French Blue", "#0072bb", { 0, 114, 187 } }, + { "French Lilac", "#86608e", { 134, 96, 142 } }, + { "French Lime", "#cf0", { 204, 255, 0 } }, + { "French Raspberry", "#c72c48", { 199, 44, 72 } }, + { "French Rose", "#f64a8a", { 246, 74, 138 } }, + { "Fuchsia", "#f0f", { 255, 0, 255 } }, + { "Fuchsia (Crayola)", "#c154c1", { 193, 84, 193 } }, + { "Fuchsia Pink", "#f7f", { 255, 119, 255 } }, + { "Fuchsia Rose", "#c74375", { 199, 67, 117 } }, + { "Fulvous", "#e48400", { 228, 132, 0 } }, + { "Fuzzy Wuzzy", "#c66", { 204, 102, 102 } }, + { "Gainsboro", "#dcdcdc", { 220, 220, 220 } }, + { "Gamboge", "#e49b0f", { 228, 155, 15 } }, + { "Ghost White", "#f8f8ff", { 248, 248, 255 } }, + { "Ginger", "#b06500", { 176, 101, 0 } }, + { "Glaucous", "#6082b6", { 96, 130, 182 } }, + { "Glitter", "#e6e8fa", { 230, 232, 250 } }, + { "Gold (Metallic)", "#d4af37", { 212, 175, 55 } }, + { "Gold (Web) (Golden)", "#ffd700", { 255, 215, 0 } }, + { "Golden Brown", "#996515", { 153, 101, 21 } }, + { "Golden Poppy", "#fcc200", { 252, 194, 0 } }, + { "Golden Yellow", "#ffdf00", { 255, 223, 0 } }, + { "Goldenrod", "#daa520", { 218, 165, 32 } }, + { "Granny Smith Apple", "#a8e4a0", { 168, 228, 160 } }, + { "Gray", "#808080", { 128, 128, 128 } }, + { "Gray-Asparagus", "#465945", { 70, 89, 69 } }, + { "Gray (Html/Css Gray)", "#808080", { 128, 128, 128 } }, + { "Gray (X11 Gray)", "#bebebe", { 190, 190, 190 } }, + { "Green (Color Wheel) (X11 Green)", "#0f0", { 0, 255, 0 } }, + { "Green (Crayola)", "#1cac78", { 28, 172, 120 } }, + { "Green (Html/Css Green)", "#008000", { 0, 128, 0 } }, + { "Green (Munsell)", "#00a877", { 0, 168, 119 } }, + { "Green (Ncs)", "#009f6b", { 0, 159, 107 } }, + { "Green (Pigment)", "#00a550", { 0, 165, 80 } }, + { "Green (Ryb)", "#66b032", { 102, 176, 50 } }, + { "Green-Yellow", "#adff2f", { 173, 255, 47 } }, + { "Grullo", "#a99a86", { 169, 154, 134 } }, + { "Guppie Green", "#00ff7f", { 0, 255, 127 } }, + { "Halaya uBe", "#663854", { 102, 56, 84 } }, + { "Han Blue", "#446ccf", { 68, 108, 207 } }, + { "Han Purple", "#5218fa", { 82, 24, 250 } }, + { "Hansa Yellow", "#e9d66b", { 233, 214, 107 } }, + { "Harlequin", "#3fff00", { 63, 255, 0 } }, + { "Harvard Crimson", "#c90016", { 201, 0, 22 } }, + { "Harvest Gold", "#da9100", { 218, 145, 0 } }, + { "Heart Gold", "#808000", { 128, 128, 0 } }, + { "Heliotrope", "#df73ff", { 223, 115, 255 } }, + { "Hollywood Cerise", "#f400a1", { 244, 0, 161 } }, + { "Honeydew", "#f0fff0", { 240, 255, 240 } }, + { "Honolulu Blue", "#007fbf", { 0, 127, 191 } }, + { "Hooker'S Green", "#49796b", { 73, 121, 107 } }, + { "Hot Magenta", "#ff1dce", { 255, 29, 206 } }, + { "Hot Pink", "#ff69b4", { 255, 105, 180 } }, + { "Hunter Green", "#355e3b", { 53, 94, 59 } }, + { "Iceberg", "#71a6d2", { 113, 166, 210 } }, + { "Icterine", "#fcf75e", { 252, 247, 94 } }, + { "Imperial Blue", "#002395", { 0, 35, 149 } }, + { "Inchworm", "#b2ec5d", { 178, 236, 93 } }, + { "India Green", "#138808", { 19, 136, 8 } }, + { "Indian Red", "#cd5c5c", { 205, 92, 92 } }, + { "Indian Yellow", "#e3a857", { 227, 168, 87 } }, + { "Indigo", "#6f00ff", { 111, 0, 255 } }, + { "Indigo (Dye)", "#00416a", { 0, 65, 106 } }, + { "Indigo (Web)", "#4b0082", { 75, 0, 130 } }, + { "International Klein Blue", "#002fa7", { 0, 47, 167 } }, + { "International Orange (Aerospace)", "#ff4f00", { 255, 79, 0 } }, + { "International Orange (Engineering)", "#ba160c", { 186, 22, 12 } }, + { "International Orange (Golden Gate Bridge)", "#c0362c", { 192, 54, 44 } }, + { "Iris", "#5a4fcf", { 90, 79, 207 } }, + { "Isabelline", "#f4f0ec", { 244, 240, 236 } }, + { "Islamic Green", "#009000", { 0, 144, 0 } }, + { "Ivory", "#fffff0", { 255, 255, 240 } }, + { "Jade", "#00a86b", { 0, 168, 107 } }, + { "Jasmine", "#f8de7e", { 248, 222, 126 } }, + { "Jasper", "#d73b3e", { 215, 59, 62 } }, + { "Jazzberry Jam", "#a50b5e", { 165, 11, 94 } }, + { "Jet", "#343434", { 52, 52, 52 } }, + { "Jonquil", "#fada5e", { 250, 218, 94 } }, + { "June Bud", "#bdda57", { 189, 218, 87 } }, + { "Jungle Green", "#29ab87", { 41, 171, 135 } }, + { "Kelly Green", "#4cbb17", { 76, 187, 23 } }, + { "Kenyan Copper", "#7c1c05", { 124, 28, 5 } }, + { "Khaki (Html/Css) (Khaki)", "#c3b091", { 195, 176, 145 } }, + { "Khaki (X11) (Light Khaki)", "#f0e68c", { 240, 230, 140 } }, + { "Ku Crimson", "#e8000d", { 232, 0, 13 } }, + { "La Salle Green", "#087830", { 8, 120, 48 } }, + { "Languid Lavender", "#d6cadd", { 214, 202, 221 } }, + { "Lapis Lazuli", "#26619c", { 38, 97, 156 } }, + { "Laser Lemon", "#fefe22", { 254, 254, 34 } }, + { "Laurel Green", "#a9ba9d", { 169, 186, 157 } }, + { "Lava", "#cf1020", { 207, 16, 32 } }, + { "Lavender Blue", "#ccf", { 204, 204, 255 } }, + { "Lavender Blush", "#fff0f5", { 255, 240, 245 } }, + { "Lavender (Floral)", "#b57edc", { 181, 126, 220 } }, + { "Lavender Gray", "#c4c3d0", { 196, 195, 208 } }, + { "Lavender Indigo", "#9457eb", { 148, 87, 235 } }, + { "Lavender Magenta", "#ee82ee", { 238, 130, 238 } }, + { "Lavender Mist", "#e6e6fa", { 230, 230, 250 } }, + { "Lavender Pink", "#fbaed2", { 251, 174, 210 } }, + { "Lavender Purple", "#967bb6", { 150, 123, 182 } }, + { "Lavender Rose", "#fba0e3", { 251, 160, 227 } }, + { "Lavender (Web)", "#e6e6fa", { 230, 230, 250 } }, + { "Lawn Green", "#7cfc00", { 124, 252, 0 } }, + { "Lemon", "#fff700", { 255, 247, 0 } }, + { "Lemon Chiffon", "#fffacd", { 255, 250, 205 } }, + { "Lemon Lime", "#e3ff00", { 227, 255, 0 } }, + { "Licorice", "#1a1110", { 26, 17, 16 } }, + { "Light Apricot", "#fdd5b1", { 253, 213, 177 } }, + { "Light Blue", "#add8e6", { 173, 216, 230 } }, + { "Light Brown", "#b5651d", { 181, 101, 29 } }, + { "Light Carmine Pink", "#e66771", { 230, 103, 113 } }, + { "Light Coral", "#f08080", { 240, 128, 128 } }, + { "Light Cornflower Blue", "#93ccea", { 147, 204, 234 } }, + { "Light Crimson", "#f56991", { 245, 105, 145 } }, + { "Light Cyan", "#e0ffff", { 224, 255, 255 } }, + { "Light Fuchsia Pink", "#f984ef", { 249, 132, 239 } }, + { "Light Goldenrod Yellow", "#fafad2", { 250, 250, 210 } }, + { "Light Gray", "#d3d3d3", { 211, 211, 211 } }, + { "Light Green", "#90ee90", { 144, 238, 144 } }, + { "Light Khaki", "#f0e68c", { 240, 230, 140 } }, + { "Light Pastel Purple", "#b19cd9", { 177, 156, 217 } }, + { "Light Pink", "#ffb6c1", { 255, 182, 193 } }, + { "Light Red Ochre", "#e97451", { 233, 116, 81 } }, + { "Light Salmon", "#ffa07a", { 255, 160, 122 } }, + { "Light Salmon Pink", "#f99", { 255, 153, 153 } }, + { "Light Sea Green", "#20b2aa", { 32, 178, 170 } }, + { "Light Sky Blue", "#87cefa", { 135, 206, 250 } }, + { "Light Slate Gray", "#789", { 119, 136, 153 } }, + { "Light Taupe", "#b38b6d", { 179, 139, 109 } }, + { "Light Thulian Pink", "#e68fac", { 230, 143, 172 } }, + { "Light Yellow", "#ffffe0", { 255, 255, 224 } }, + { "Lilac", "#c8a2c8", { 200, 162, 200 } }, + { "Lime (Color Wheel)", "#bfff00", { 191, 255, 0 } }, + { "Lime Green", "#32cd32", { 50, 205, 50 } }, + { "Lime (Web) (X11 Green)", "#0f0", { 0, 255, 0 } }, + { "Limerick", "#9dc209", { 157, 194, 9 } }, + { "Lincoln Green", "#195905", { 25, 89, 5 } }, + { "Linen", "#faf0e6", { 250, 240, 230 } }, + { "Lion", "#c19a6b", { 193, 154, 107 } }, + { "Little Boy Blue", "#6ca0dc", { 108, 160, 220 } }, + { "Liver", "#534b4f", { 83, 75, 79 } }, + { "Lust", "#e62020", { 230, 32, 32 } }, + { "Magenta", "#f0f", { 255, 0, 255 } }, + { "Magenta (Dye)", "#ca1f7b", { 202, 31, 123 } }, + { "Magenta (Process)", "#ff0090", { 255, 0, 144 } }, + { "Magic Mint", "#aaf0d1", { 170, 240, 209 } }, + { "Magnolia", "#f8f4ff", { 248, 244, 255 } }, + { "Mahogany", "#c04000", { 192, 64, 0 } }, + { "Maize", "#fbec5d", { 251, 236, 93 } }, + { "Majorelle Blue", "#6050dc", { 96, 80, 220 } }, + { "Malachite", "#0bda51", { 11, 218, 81 } }, + { "Manatee", "#979aaa", { 151, 154, 170 } }, + { "Mango Tango", "#ff8243", { 255, 130, 67 } }, + { "Mantis", "#74c365", { 116, 195, 101 } }, + { "Mardi Gras", "#880085", { 136, 0, 133 } }, + { "Maroon (Crayola)", "#c32148", { 195, 33, 72 } }, + { "Maroon (Html/Css)", "#800000", { 128, 0, 0 } }, + { "Maroon (X11)", "#b03060", { 176, 48, 96 } }, + { "Mauve", "#e0b0ff", { 224, 176, 255 } }, + { "Mauve Taupe", "#915f6d", { 145, 95, 109 } }, + { "Mauvelous", "#ef98aa", { 239, 152, 170 } }, + { "Maya Blue", "#73c2fb", { 115, 194, 251 } }, + { "Meat Brown", "#e5b73b", { 229, 183, 59 } }, + { "Medium Aquamarine", "#6da", { 102, 221, 170 } }, + { "Medium Blue", "#0000cd", { 0, 0, 205 } }, + { "Medium Candy Apple Red", "#e2062c", { 226, 6, 44 } }, + { "Medium Carmine", "#af4035", { 175, 64, 53 } }, + { "Medium Champagne", "#f3e5ab", { 243, 229, 171 } }, + { "Medium Electric Blue", "#035096", { 3, 80, 150 } }, + { "Medium Jungle Green", "#1c352d", { 28, 53, 45 } }, + { "Medium Lavender Magenta", "#dda0dd", { 221, 160, 221 } }, + { "Medium Orchid", "#ba55d3", { 186, 85, 211 } }, + { "Medium Persian Blue", "#0067a5", { 0, 103, 165 } }, + { "Medium Purple", "#9370db", { 147, 112, 219 } }, + { "Medium Red-Violet", "#bb3385", { 187, 51, 133 } }, + { "Medium Ruby", "#aa4069", { 170, 64, 105 } }, + { "Medium Sea Green", "#3cb371", { 60, 179, 113 } }, + { "Medium Slate Blue", "#7b68ee", { 123, 104, 238 } }, + { "Medium Spring Bud", "#c9dc87", { 201, 220, 135 } }, + { "Medium Spring Green", "#00fa9a", { 0, 250, 154 } }, + { "Medium Taupe", "#674c47", { 103, 76, 71 } }, + { "Medium Turquoise", "#48d1cc", { 72, 209, 204 } }, + { "Medium Tuscan Red", "#79443b", { 121, 68, 59 } }, + { "Medium Vermilion", "#d9603b", { 217, 96, 59 } }, + { "Medium Violet-Red", "#c71585", { 199, 21, 133 } }, + { "Mellow Apricot", "#f8b878", { 248, 184, 120 } }, + { "Mellow Yellow", "#f8de7e", { 248, 222, 126 } }, + { "Melon", "#fdbcb4", { 253, 188, 180 } }, + { "Midnight Blue", "#191970", { 25, 25, 112 } }, + { "Midnight Green (Eagle Green)", "#004953", { 0, 73, 83 } }, + { "Mikado Yellow", "#ffc40c", { 255, 196, 12 } }, + { "Mint", "#3eb489", { 62, 180, 137 } }, + { "Mint Cream", "#f5fffa", { 245, 255, 250 } }, + { "Mint Green", "#98ff98", { 152, 255, 152 } }, + { "Misty Rose", "#ffe4e1", { 255, 228, 225 } }, + { "Moccasin", "#faebd7", { 250, 235, 215 } }, + { "Mode Beige", "#967117", { 150, 113, 23 } }, + { "Moonstone Blue", "#73a9c2", { 115, 169, 194 } }, + { "Mordant Red 19", "#ae0c00", { 174, 12, 0 } }, + { "Moss Green", "#addfad", { 173, 223, 173 } }, + { "Mountain Meadow", "#30ba8f", { 48, 186, 143 } }, + { "Mountbatten Pink", "#997a8d", { 153, 122, 141 } }, + { "Msu Green", "#18453b", { 24, 69, 59 } }, + { "Mulberry", "#c54b8c", { 197, 75, 140 } }, + { "Mustard", "#ffdb58", { 255, 219, 88 } }, + { "Myrtle", "#21421e", { 33, 66, 30 } }, + { "Nadeshiko Pink", "#f6adc6", { 246, 173, 198 } }, + { "Napier Green", "#2a8000", { 42, 128, 0 } }, + { "Naples Yellow", "#fada5e", { 250, 218, 94 } }, + { "Navajo White", "#ffdead", { 255, 222, 173 } }, + { "Navy Blue", "#000080", { 0, 0, 128 } }, + { "Neon Carrot", "#ffa343", { 255, 163, 67 } }, + { "Neon Fuchsia", "#fe4164", { 254, 65, 100 } }, + { "Neon Green", "#39ff14", { 57, 255, 20 } }, + { "New York Pink", "#d7837f", { 215, 131, 127 } }, + { "Non-Photo Blue", "#a4dded", { 164, 221, 237 } }, + { "North Texas Green", "#059033", { 5, 144, 51 } }, + { "Ocean Boat Blue", "#0077be", { 0, 119, 190 } }, + { "Ochre", "#c72", { 204, 119, 34 } }, + { "Office Green", "#008000", { 0, 128, 0 } }, + { "Old Gold", "#cfb53b", { 207, 181, 59 } }, + { "Old Lace", "#fdf5e6", { 253, 245, 230 } }, + { "Old Lavender", "#796878", { 121, 104, 120 } }, + { "Old Mauve", "#673147", { 103, 49, 71 } }, + { "Old Rose", "#c08081", { 192, 128, 129 } }, + { "Olive", "#808000", { 128, 128, 0 } }, + { "Olive Drab #7", "#3c341f", { 60, 52, 31 } }, + { "Olive Drab (Web) (Olive Drab #3)", "#6b8e23", { 107, 142, 35 } }, + { "Olivine", "#9ab973", { 154, 185, 115 } }, + { "Onyx", "#353839", { 53, 56, 57 } }, + { "Opera Mauve", "#b784a7", { 183, 132, 167 } }, + { "Orange (Color Wheel)", "#ff7f00", { 255, 127, 0 } }, + { "Orange Peel", "#ff9f00", { 255, 159, 0 } }, + { "Orange-Red", "#ff4500", { 255, 69, 0 } }, + { "Orange (Ryb)", "#fb9902", { 251, 153, 2 } }, + { "Orange (Web Color)", "#ffa500", { 255, 165, 0 } }, + { "Orchid", "#da70d6", { 218, 112, 214 } }, + { "Otter Brown", "#654321", { 101, 67, 33 } }, + { "Ou Crimson Red", "#900", { 153, 0, 0 } }, + { "Outer Space", "#414a4c", { 65, 74, 76 } }, + { "Outrageous Orange", "#ff6e4a", { 255, 110, 74 } }, + { "Oxford Blue", "#002147", { 0, 33, 71 } }, + { "Pakistan Green", "#060", { 0, 102, 0 } }, + { "Palatinate Blue", "#273be2", { 39, 59, 226 } }, + { "Palatinate Purple", "#682860", { 104, 40, 96 } }, + { "Pale Aqua", "#bcd4e6", { 188, 212, 230 } }, + { "Pale Blue", "#afeeee", { 175, 238, 238 } }, + { "Pale Brown", "#987654", { 152, 118, 84 } }, + { "Pale Carmine", "#af4035", { 175, 64, 53 } }, + { "Pale Cerulean", "#9bc4e2", { 155, 196, 226 } }, + { "Pale Chestnut", "#ddadaf", { 221, 173, 175 } }, + { "Pale Copper", "#da8a67", { 218, 138, 103 } }, + { "Pale Cornflower Blue", "#abcdef", { 171, 205, 239 } }, + { "Pale Gold", "#e6be8a", { 230, 190, 138 } }, + { "Pale Goldenrod", "#eee8aa", { 238, 232, 170 } }, + { "Pale Green", "#98fb98", { 152, 251, 152 } }, + { "Pale Lavender", "#dcd0ff", { 220, 208, 255 } }, + { "Pale Magenta", "#f984e5", { 249, 132, 229 } }, + { "Pale Pink", "#fadadd", { 250, 218, 221 } }, + { "Pale Plum", "#dda0dd", { 221, 160, 221 } }, + { "Pale Red-Violet", "#db7093", { 219, 112, 147 } }, + { "Pale Robin Egg Blue", "#96ded1", { 150, 222, 209 } }, + { "Pale Silver", "#c9c0bb", { 201, 192, 187 } }, + { "Pale Spring Bud", "#ecebbd", { 236, 235, 189 } }, + { "Pale Taupe", "#bc987e", { 188, 152, 126 } }, + { "Pale Violet-Red", "#db7093", { 219, 112, 147 } }, + { "Pansy Purple", "#78184a", { 120, 24, 74 } }, + { "Papaya Whip", "#ffefd5", { 255, 239, 213 } }, + { "Paris Green", "#50c878", { 80, 200, 120 } }, + { "Pastel Blue", "#aec6cf", { 174, 198, 207 } }, + { "Pastel Brown", "#836953", { 131, 105, 83 } }, + { "Pastel Gray", "#cfcfc4", { 207, 207, 196 } }, + { "Pastel Green", "#7d7", { 119, 221, 119 } }, + { "Pastel Magenta", "#f49ac2", { 244, 154, 194 } }, + { "Pastel Orange", "#ffb347", { 255, 179, 71 } }, + { "Pastel Pink", "#dea5a4", { 222, 165, 164 } }, + { "Pastel Purple", "#b39eb5", { 179, 158, 181 } }, + { "Pastel Red", "#ff6961", { 255, 105, 97 } }, + { "Pastel Violet", "#cb99c9", { 203, 153, 201 } }, + { "Pastel Yellow", "#fdfd96", { 253, 253, 150 } }, + { "Patriarch", "#800080", { 128, 0, 128 } }, + { "Payne'S Grey", "#536878", { 83, 104, 120 } }, + { "Peach", "#ffe5b4", { 255, 229, 180 } }, + { "Peach (Crayola)", "#ffcba4", { 255, 203, 164 } }, + { "Peach-Orange", "#fc9", { 255, 204, 153 } }, + { "Peach Puff", "#ffdab9", { 255, 218, 185 } }, + { "Peach-Yellow", "#fadfad", { 250, 223, 173 } }, + { "Pear", "#d1e231", { 209, 226, 49 } }, + { "Pearl", "#eae0c8", { 234, 224, 200 } }, + { "Pearl Aqua", "#88d8c0", { 136, 216, 192 } }, + { "Pearly Purple", "#b768a2", { 183, 104, 162 } }, + { "Peridot", "#e6e200", { 230, 226, 0 } }, + { "Periwinkle", "#ccf", { 204, 204, 255 } }, + { "Persian Blue", "#1c39bb", { 28, 57, 187 } }, + { "Persian Green", "#00a693", { 0, 166, 147 } }, + { "Persian Indigo", "#32127a", { 50, 18, 122 } }, + { "Persian Orange", "#d99058", { 217, 144, 88 } }, + { "Persian Pink", "#f77fbe", { 247, 127, 190 } }, + { "Persian Plum", "#701c1c", { 112, 28, 28 } }, + { "Persian Red", "#c33", { 204, 51, 51 } }, + { "Persian Rose", "#fe28a2", { 254, 40, 162 } }, + { "Persimmon", "#ec5800", { 236, 88, 0 } }, + { "Peru", "#cd853f", { 205, 133, 63 } }, + { "Phlox", "#df00ff", { 223, 0, 255 } }, + { "Phthalo Blue", "#000f89", { 0, 15, 137 } }, + { "Phthalo Green", "#123524", { 18, 53, 36 } }, + { "Piggy Pink", "#fddde6", { 253, 221, 230 } }, + { "Pine Green", "#01796f", { 1, 121, 111 } }, + { "Pink", "#ffc0cb", { 255, 192, 203 } }, + { "Pink Lace", "#ffddf4", { 255, 221, 244 } }, + { "Pink-Orange", "#f96", { 255, 153, 102 } }, + { "Pink Pearl", "#e7accf", { 231, 172, 207 } }, + { "Pink Sherbet", "#f78fa7", { 247, 143, 167 } }, + { "Pistachio", "#93c572", { 147, 197, 114 } }, + { "Platinum", "#e5e4e2", { 229, 228, 226 } }, + { "Plum (Traditional)", "#8e4585", { 142, 69, 133 } }, + { "Plum (Web)", "#dda0dd", { 221, 160, 221 } }, + { "Portland Orange", "#ff5a36", { 255, 90, 54 } }, + { "Powder Blue (Web)", "#b0e0e6", { 176, 224, 230 } }, + { "Princeton Orange", "#ff8f00", { 255, 143, 0 } }, + { "Prune", "#701c1c", { 112, 28, 28 } }, + { "Prussian Blue", "#003153", { 0, 49, 83 } }, + { "Psychedelic Purple", "#df00ff", { 223, 0, 255 } }, + { "Puce", "#c89", { 204, 136, 153 } }, + { "Pumpkin", "#ff7518", { 255, 117, 24 } }, + { "Purple Heart", "#69359c", { 105, 53, 156 } }, + { "Purple (Html/Css)", "#800080", { 128, 0, 128 } }, + { "Purple Mountain Majesty", "#9678b6", { 150, 120, 182 } }, + { "Purple (Munsell)", "#9f00c5", { 159, 0, 197 } }, + { "Purple Pizzazz", "#fe4eda", { 254, 78, 218 } }, + { "Purple Taupe", "#50404d", { 80, 64, 77 } }, + { "Purple (X11)", "#a020f0", { 160, 32, 240 } }, + { "Quartz", "#51484f", { 81, 72, 79 } }, + { "Rackley", "#5d8aa8", { 93, 138, 168 } }, + { "Radical Red", "#ff355e", { 255, 53, 94 } }, + { "Rajah", "#fbab60", { 251, 171, 96 } }, + { "Raspberry", "#e30b5d", { 227, 11, 93 } }, + { "Raspberry Glace", "#915f6d", { 145, 95, 109 } }, + { "Raspberry Pink", "#e25098", { 226, 80, 152 } }, + { "Raspberry Rose", "#b3446c", { 179, 68, 108 } }, + { "Raw Umber", "#826644", { 130, 102, 68 } }, + { "Razzle Dazzle Rose", "#f3c", { 255, 51, 204 } }, + { "Razzmatazz", "#e3256b", { 227, 37, 107 } }, + { "Red", "#f00", { 255, 0, 0 } }, + { "Red-Brown", "#a52a2a", { 165, 42, 42 } }, + { "Red Devil", "#860111", { 134, 1, 17 } }, + { "Red (Munsell)", "#f2003c", { 242, 0, 60 } }, + { "Red (Ncs)", "#c40233", { 196, 2, 51 } }, + { "Red-Orange", "#ff5349", { 255, 83, 73 } }, + { "Red (Pigment)", "#ed1c24", { 237, 28, 36 } }, + { "Red (Ryb)", "#fe2712", { 254, 39, 18 } }, + { "Red-Violet", "#c71585", { 199, 21, 133 } }, + { "Redwood", "#ab4e52", { 171, 78, 82 } }, + { "Regalia", "#522d80", { 82, 45, 128 } }, + { "Resolution Blue", "#002387", { 0, 35, 135 } }, + { "Rich Black", "#004040", { 0, 64, 64 } }, + { "Rich Brilliant Lavender", "#f1a7fe", { 241, 167, 254 } }, + { "Rich Carmine", "#d70040", { 215, 0, 64 } }, + { "Rich Electric Blue", "#0892d0", { 8, 146, 208 } }, + { "Rich Lavender", "#a76bcf", { 167, 107, 207 } }, + { "Rich Lilac", "#b666d2", { 182, 102, 210 } }, + { "Rich Maroon", "#b03060", { 176, 48, 96 } }, + { "Rifle Green", "#414833", { 65, 72, 51 } }, + { "Robin Egg Blue", "#0cc", { 0, 204, 204 } }, + { "Rose", "#ff007f", { 255, 0, 127 } }, + { "Rose Bonbon", "#f9429e", { 249, 66, 158 } }, + { "Rose Ebony", "#674846", { 103, 72, 70 } }, + { "Rose Gold", "#b76e79", { 183, 110, 121 } }, + { "Rose Madder", "#e32636", { 227, 38, 54 } }, + { "Rose Pink", "#f6c", { 255, 102, 204 } }, + { "Rose Quartz", "#aa98a9", { 170, 152, 169 } }, + { "Rose Taupe", "#905d5d", { 144, 93, 93 } }, + { "Rose Vale", "#ab4e52", { 171, 78, 82 } }, + { "Rosewood", "#65000b", { 101, 0, 11 } }, + { "Rosso Corsa", "#d40000", { 212, 0, 0 } }, + { "Rosy Brown", "#bc8f8f", { 188, 143, 143 } }, + { "Royal Azure", "#0038a8", { 0, 56, 168 } }, + { "Royal Blue (Traditional)", "#002366", { 0, 35, 102 } }, + { "Royal Blue (Web)", "#4169e1", { 65, 105, 225 } }, + { "Royal Fuchsia", "#ca2c92", { 202, 44, 146 } }, + { "Royal Purple", "#7851a9", { 120, 81, 169 } }, + { "Royal Yellow", "#fada5e", { 250, 218, 94 } }, + { "Rubine Red", "#d10056", { 209, 0, 86 } }, + { "Ruby", "#e0115f", { 224, 17, 95 } }, + { "Ruby Red", "#9b111e", { 155, 17, 30 } }, + { "Ruddy", "#ff0028", { 255, 0, 40 } }, + { "Ruddy Brown", "#bb6528", { 187, 101, 40 } }, + { "Ruddy Pink", "#e18e96", { 225, 142, 150 } }, + { "Rufous", "#a81c07", { 168, 28, 7 } }, + { "Russet", "#80461b", { 128, 70, 27 } }, + { "Rust", "#b7410e", { 183, 65, 14 } }, + { "Rusty Red", "#da2c43", { 218, 44, 67 } }, + { "Sacramento State Green", "#00563f", { 0, 86, 63 } }, + { "Saddle Brown", "#8b4513", { 139, 69, 19 } }, + { "Safety Orange (Blaze Orange)", "#ff6700", { 255, 103, 0 } }, + { "Saffron", "#f4c430", { 244, 196, 48 } }, + { "Salmon", "#ff8c69", { 255, 140, 105 } }, + { "Salmon Pink", "#ff91a4", { 255, 145, 164 } }, + { "Sand", "#c2b280", { 194, 178, 128 } }, + { "Sand Dune", "#967117", { 150, 113, 23 } }, + { "Sandstorm", "#ecd540", { 236, 213, 64 } }, + { "Sandy Brown", "#f4a460", { 244, 164, 96 } }, + { "Sandy Taupe", "#967117", { 150, 113, 23 } }, + { "Sangria", "#92000a", { 146, 0, 10 } }, + { "Sap Green", "#507d2a", { 80, 125, 42 } }, + { "Sapphire", "#0f52ba", { 15, 82, 186 } }, + { "Sapphire Blue", "#0067a5", { 0, 103, 165 } }, + { "Satin Sheen Gold", "#cba135", { 203, 161, 53 } }, + { "Scarlet", "#ff2400", { 255, 36, 0 } }, + { "Scarlet (Crayola)", "#fd0e35", { 253, 14, 53 } }, + { "School Bus Yellow", "#ffd800", { 255, 216, 0 } }, + { "Screamin' Green", "#76ff7a", { 118, 255, 122 } }, + { "Sea Blue", "#006994", { 0, 105, 148 } }, + { "Sea Green", "#2e8b57", { 46, 139, 87 } }, + { "Seal Brown", "#321414", { 50, 20, 20 } }, + { "Seashell", "#fff5ee", { 255, 245, 238 } }, + { "Selective Yellow", "#ffba00", { 255, 186, 0 } }, + { "Sepia", "#704214", { 112, 66, 20 } }, + { "Shadow", "#8a795d", { 138, 121, 93 } }, + { "Shamrock Green", "#009e60", { 0, 158, 96 } }, + { "Shocking Pink", "#fc0fc0", { 252, 15, 192 } }, + { "Shocking Pink (Crayola)", "#ff6fff", { 255, 111, 255 } }, + { "Sienna", "#882d17", { 136, 45, 23 } }, + { "Silver", "#c0c0c0", { 192, 192, 192 } }, + { "Sinopia", "#cb410b", { 203, 65, 11 } }, + { "Skobeloff", "#007474", { 0, 116, 116 } }, + { "Sky Blue", "#87ceeb", { 135, 206, 235 } }, + { "Sky Magenta", "#cf71af", { 207, 113, 175 } }, + { "Slate Blue", "#6a5acd", { 106, 90, 205 } }, + { "Slate Gray", "#708090", { 112, 128, 144 } }, + { "Smalt (Dark Powder Blue)", "#039", { 0, 51, 153 } }, + { "Smokey Topaz", "#933d41", { 147, 61, 65 } }, + { "Smoky Black", "#100c08", { 16, 12, 8 } }, + { "Snow", "#fffafa", { 255, 250, 250 } }, + { "Spiro Disco Ball", "#0fc0fc", { 15, 192, 252 } }, + { "Spring Bud", "#a7fc00", { 167, 252, 0 } }, + { "Spring Green", "#00ff7f", { 0, 255, 127 } }, + { "St. Patrick'S Blue", "#23297a", { 35, 41, 122 } }, + { "Steel Blue", "#4682b4", { 70, 130, 180 } }, + { "Stil De Grain Yellow", "#fada5e", { 250, 218, 94 } }, + { "Stizza", "#900", { 153, 0, 0 } }, + { "Stormcloud", "#4f666a", { 79, 102, 106 } }, + { "Straw", "#e4d96f", { 228, 217, 111 } }, + { "Sunglow", "#fc3", { 255, 204, 51 } }, + { "Sunset", "#fad6a5", { 250, 214, 165 } }, + { "Tan", "#d2b48c", { 210, 180, 140 } }, + { "Tangelo", "#f94d00", { 249, 77, 0 } }, + { "Tangerine", "#f28500", { 242, 133, 0 } }, + { "Tangerine Yellow", "#fc0", { 255, 204, 0 } }, + { "Tango Pink", "#e4717a", { 228, 113, 122 } }, + { "Taupe", "#483c32", { 72, 60, 50 } }, + { "Taupe Gray", "#8b8589", { 139, 133, 137 } }, + { "Tea Green", "#d0f0c0", { 208, 240, 192 } }, + { "Tea Rose (Orange)", "#f88379", { 248, 131, 121 } }, + { "Tea Rose (Rose)", "#f4c2c2", { 244, 194, 194 } }, + { "Teal", "#008080", { 0, 128, 128 } }, + { "Teal Blue", "#367588", { 54, 117, 136 } }, + { "Teal Green", "#00827f", { 0, 130, 127 } }, + { "Telemagenta", "#cf3476", { 207, 52, 118 } }, + { "Tenne (Tawny)", "#cd5700", { 205, 87, 0 } }, + { "Terra Cotta", "#e2725b", { 226, 114, 91 } }, + { "Thistle", "#d8bfd8", { 216, 191, 216 } }, + { "Thulian Pink", "#de6fa1", { 222, 111, 161 } }, + { "Tickle Me Pink", "#fc89ac", { 252, 137, 172 } }, + { "Tiffany Blue", "#0abab5", { 10, 186, 181 } }, + { "Tiger'S Eye", "#e08d3c", { 224, 141, 60 } }, + { "Timberwolf", "#dbd7d2", { 219, 215, 210 } }, + { "Titanium Yellow", "#eee600", { 238, 230, 0 } }, + { "Tomato", "#ff6347", { 255, 99, 71 } }, + { "Toolbox", "#746cc0", { 116, 108, 192 } }, + { "Topaz", "#ffc87c", { 255, 200, 124 } }, + { "Tractor Red", "#fd0e35", { 253, 14, 53 } }, + { "Trolley Grey", "#808080", { 128, 128, 128 } }, + { "Tropical Rain Forest", "#00755e", { 0, 117, 94 } }, + { "True Blue", "#0073cf", { 0, 115, 207 } }, + { "Tufts Blue", "#417dc1", { 65, 125, 193 } }, + { "Tumbleweed", "#deaa88", { 222, 170, 136 } }, + { "Turkish Rose", "#b57281", { 181, 114, 129 } }, + { "Turquoise", "#30d5c8", { 48, 213, 200 } }, + { "Turquoise Blue", "#00ffef", { 0, 255, 239 } }, + { "Turquoise Green", "#a0d6b4", { 160, 214, 180 } }, + { "Tuscan Red", "#7c4848", { 124, 72, 72 } }, + { "Twilight Lavender", "#8a496b", { 138, 73, 107 } }, + { "Tyrian Purple", "#66023c", { 102, 2, 60 } }, + { "Ua Blue", "#03a", { 0, 51, 170 } }, + { "Ua Red", "#d9004c", { 217, 0, 76 } }, + { "Ube", "#8878c3", { 136, 120, 195 } }, + { "Ucla Blue", "#536895", { 83, 104, 149 } }, + { "Ucla Gold", "#ffb300", { 255, 179, 0 } }, + { "Ufo Green", "#3cd070", { 60, 208, 112 } }, + { "Ultra Pink", "#ff6fff", { 255, 111, 255 } }, + { "Ultramarine", "#120a8f", { 18, 10, 143 } }, + { "Ultramarine Blue", "#4166f5", { 65, 102, 245 } }, + { "Umber", "#635147", { 99, 81, 71 } }, + { "Unbleached Silk", "#ffddca", { 255, 221, 202 } }, + { "United Nations Blue", "#5b92e5", { 91, 146, 229 } }, + { "University Of California Gold", "#b78727", { 183, 135, 39 } }, + { "Unmellow Yellow", "#ff6", { 255, 255, 102 } }, + { "Up Forest Green", "#014421", { 1, 68, 33 } }, + { "Up Maroon", "#7b1113", { 123, 17, 19 } }, + { "Upsdell Red", "#ae2029", { 174, 32, 41 } }, + { "Urobilin", "#e1ad21", { 225, 173, 33 } }, + { "Usafa Blue", "#004f98", { 0, 79, 152 } }, + { "Usc Cardinal", "#900", { 153, 0, 0 } }, + { "Usc Gold", "#fc0", { 255, 204, 0 } }, + { "Utah Crimson", "#d3003f", { 211, 0, 63 } }, + { "Vanilla", "#f3e5ab", { 243, 229, 171 } }, + { "Vegas Gold", "#c5b358", { 197, 179, 88 } }, + { "Venetian Red", "#c80815", { 200, 8, 21 } }, + { "Verdigris", "#43b3ae", { 67, 179, 174 } }, + { "Vermilion (Cinnabar)", "#e34234", { 227, 66, 52 } }, + { "Vermilion (Plochere)", "#d9603b", { 217, 96, 59 } }, + { "Veronica", "#a020f0", { 160, 32, 240 } }, + { "Violet", "#8f00ff", { 143, 0, 255 } }, + { "Violet-Blue", "#324ab2", { 50, 74, 178 } }, + { "Violet (Color Wheel)", "#7f00ff", { 127, 0, 255 } }, + { "Violet (Ryb)", "#8601af", { 134, 1, 175 } }, + { "Violet (Web)", "#ee82ee", { 238, 130, 238 } }, + { "Viridian", "#40826d", { 64, 130, 109 } }, + { "Vivid Auburn", "#922724", { 146, 39, 36 } }, + { "Vivid Burgundy", "#9f1d35", { 159, 29, 53 } }, + { "Vivid Cerise", "#da1d81", { 218, 29, 129 } }, + { "Vivid Tangerine", "#ffa089", { 255, 160, 137 } }, + { "Vivid Violet", "#9f00ff", { 159, 0, 255 } }, + { "Warm Black", "#004242", { 0, 66, 66 } }, + { "Waterspout", "#a4f4f9", { 164, 244, 249 } }, + { "Wenge", "#645452", { 100, 84, 82 } }, + { "Wheat", "#f5deb3", { 245, 222, 179 } }, + { "White", "#fff", { 255, 255, 255 } }, + { "White Smoke", "#f5f5f5", { 245, 245, 245 } }, + { "Wild Blue Yonder", "#a2add0", { 162, 173, 208 } }, + { "Wild Strawberry", "#ff43a4", { 255, 67, 164 } }, + { "Wild Watermelon", "#fc6c85", { 252, 108, 133 } }, + { "Wine", "#722f37", { 114, 47, 55 } }, + { "Wine Dregs", "#673147", { 103, 49, 71 } }, + { "Wisteria", "#c9a0dc", { 201, 160, 220 } }, + { "Wood Brown", "#c19a6b", { 193, 154, 107 } }, + { "Xanadu", "#738678", { 115, 134, 120 } }, + { "Yale Blue", "#0f4d92", { 15, 77, 146 } }, + { "Yellow", "#ff0", { 255, 255, 0 } }, + { "Yellow-Green", "#9acd32", { 154, 205, 50 } }, + { "Yellow (Munsell)", "#efcc00", { 239, 204, 0 } }, + { "Yellow (Ncs)", "#ffd300", { 255, 211, 0 } }, + { "Yellow Orange", "#ffae42", { 255, 174, 66 } }, + { "Yellow (Process)", "#ffef00", { 255, 239, 0 } }, + { "Yellow (Ryb)", "#fefe33", { 254, 254, 51 } }, + { "Zaffre", "#0014a8", { 0, 20, 168 } }, + { "Zinnwaldite Brown", "#2c1608", { 44, 22, 8 } }, + { "KulorSunsetCamping1", "2E112D", { 0x2E, 0x11, 0x2D } }, + { "KulorSunsetCamping2", "540032", { 0x54, 0x00, 0x32 } }, + { "KulorSunsetCamping3", "820333", { 0x82, 0x03, 0x33 } }, + { "KulorSunsetCamping4", "C9283E", { 0xC9, 0x28, 0x3E } }, + { "KulorSunsetCamping5", "F0433A", { 0xF0, 0x43, 0x3A } }, + { "KulorYellowShades1", "FFFF00", { 0xFF, 0xFF, 0x0 } }, + { "KulorYellowShades2", "CCCC00", { 0xCC, 0xCC, 0x0 } }, + { "KulorYellowShades3", "999900", { 0x99, 0x99, 0x0 } }, + { "KulorYellowShades4", "666600", { 0x66, 0x66, 0x0 } }, + { "KulorYellowShades5", "363600", { 0x36, 0x36, 0x0 } }, +}; + + + +// ALL COLOR SPACES MUST END WITH -1, so the code knows how long it is... + +const int KulorSunsetCamping[] = { + KULOR_SUNSET_CAMPING1, + KULOR_SUNSET_CAMPING2, + KULOR_SUNSET_CAMPING3, + KULOR_SUNSET_CAMPING4, + KULOR_SUNSET_CAMPING5, + -1 +}; + +const int All[] = { +COLOR_AIR_FORCE_BLUE_RAF, + COLOR_AIR_FORCE_BLUE_USAF, + COLOR_AIR_SUPERIORITY_BLUE, + COLOR_ALABAMA_CRIMSON, + COLOR_ALICE_BLUE, + COLOR_ALIZARIN_CRIMSON, + COLOR_ALLOY_ORANGE, + COLOR_ALMOND, + COLOR_AMARANTH, + COLOR_AMBER, + COLOR_AMBER_SAE_ECE, + COLOR_AMERICAN_ROSE, + COLOR_AMETHYST, + COLOR_ANDROID_GREEN, + COLOR_ANTI_FLASH_WHITE, + COLOR_ANTIQUE_BRASS, + COLOR_ANTIQUE_FUCHSIA, + COLOR_ANTIQUE_RUBY, + COLOR_ANTIQUE_WHITE, + COLOR_AO_ENGLISH, + COLOR_APPLE_GREEN, + COLOR_APRICOT, + COLOR_AQUA, + COLOR_AQUAMARINE, + COLOR_ARMY_GREEN, + COLOR_ARSENIC, + COLOR_ARYLIDE_YELLOW, + COLOR_ASH_GREY, + COLOR_ASPARAGUS, + COLOR_ATOMIC_TANGERINE, + COLOR_AUBURN, + COLOR_AUREOLIN, + COLOR_AUROMETALSAURUS, + COLOR_AVOCADO, + COLOR_AZURE, + COLOR_AZURE_MIST_WEB, + COLOR_BABY_BLUE, + COLOR_BABY_BLUE_EYES, + COLOR_BABY_PINK, + COLOR_BALL_BLUE, + COLOR_BANANA_MANIA, + COLOR_BANANA_YELLOW, + COLOR_BARN_RED, + COLOR_BATTLESHIP_GREY, + COLOR_BAZAAR, + COLOR_BEAU_BLUE, + COLOR_BEAVER, + COLOR_BEIGE, + COLOR_BIG_DIP_O_RUBY, + COLOR_BISQUE, + COLOR_BISTRE, + COLOR_BITTERSWEET, + COLOR_BITTERSWEET_SHIMMER, + COLOR_BLACK, + COLOR_BLACK_BEAN, + COLOR_BLACK_LEATHER_JACKET, + COLOR_BLACK_OLIVE, + COLOR_BLANCHED_ALMOND, + COLOR_BLAST_OFF_BRONZE, + COLOR_BLEU_DE_FRANCE, + COLOR_BLIZZARD_BLUE, + COLOR_BLOND, + COLOR_BLUE, + COLOR_BLUE_BELL, + COLOR_BLUE_CRAYOLA, + COLOR_BLUE_GRAY, + COLOR_BLUE_GREEN, + COLOR_BLUE_MUNSELL, + COLOR_BLUE_NCS, + COLOR_BLUE_PIGMENT, + COLOR_BLUE_RYB, + COLOR_BLUE_SAPPHIRE, + COLOR_BLUE_VIOLET, + COLOR_BLUSH, + COLOR_BOLE, + COLOR_BONDI_BLUE, + COLOR_BONE, + COLOR_BOSTON_UNIVERSITY_RED, + COLOR_BOTTLE_GREEN, + COLOR_BOYSENBERRY, + COLOR_BRANDEIS_BLUE, + COLOR_BRASS, + COLOR_BRICK_RED, + COLOR_BRIGHT_CERULEAN, + COLOR_BRIGHT_GREEN, + COLOR_BRIGHT_LAVENDER, + COLOR_BRIGHT_MAROON, + COLOR_BRIGHT_PINK, + COLOR_BRIGHT_TURQUOISE, + COLOR_BRIGHT_UBE, + COLOR_BRILLIANT_LAVENDER, + COLOR_BRILLIANT_ROSE, + COLOR_BRINK_PINK, + COLOR_BRITISH_RACING_GREEN, + COLOR_BRONZE, + COLOR_BROWN_TRADITIONAL, + COLOR_BROWN_WEB, + COLOR_BUBBLE_GUM, + COLOR_BUBBLES, + COLOR_BUFF, + COLOR_BULGARIAN_ROSE, + COLOR_BURGUNDY, + COLOR_BURLYWOOD, + COLOR_BURNT_ORANGE, + COLOR_BURNT_SIENNA, + COLOR_BURNT_UMBER, + COLOR_BYZANTINE, + COLOR_BYZANTIUM, + COLOR_CADET, + COLOR_CADET_BLUE, + COLOR_CADET_GREY, + COLOR_CADMIUM_GREEN, + COLOR_CADMIUM_ORANGE, + COLOR_CADMIUM_RED, + COLOR_CADMIUM_YELLOW, + COLOR_CAF_AU_LAIT, + COLOR_CAF_NOIR, + COLOR_CAL_POLY_GREEN, + COLOR_CAMBRIDGE_BLUE, + COLOR_CAMEL, + COLOR_CAMEO_PINK, + COLOR_CAMOUFLAGE_GREEN, + COLOR_CANARY_YELLOW, + COLOR_CANDY_APPLE_RED, + COLOR_CANDY_PINK, + COLOR_CAPRI, + COLOR_CAPUT_MORTUUM, + COLOR_CARDINAL, + COLOR_CARIBBEAN_GREEN, + COLOR_CARMINE, + COLOR_CARMINE_M_P, + COLOR_CARMINE_PINK, + COLOR_CARMINE_RED, + COLOR_CARNATION_PINK, + COLOR_CARNELIAN, + COLOR_CAROLINA_BLUE, + COLOR_CARROT_ORANGE, + COLOR_CATALINA_BLUE, + COLOR_CEIL, + COLOR_CELADON, + COLOR_CELADON_BLUE, + COLOR_CELADON_GREEN, + COLOR_CELESTE_COLOUR, + COLOR_CELESTIAL_BLUE, + COLOR_CERISE, + COLOR_CERISE_PINK, + COLOR_CERULEAN, + COLOR_CERULEAN_BLUE, + COLOR_CERULEAN_FROST, + COLOR_CG_BLUE, + COLOR_CG_RED, + COLOR_CHAMOISEE, + COLOR_CHAMPAGNE, + COLOR_CHARCOAL, + COLOR_CHARM_PINK, + COLOR_CHARTREUSE_TRADITIONAL, + COLOR_CHARTREUSE_WEB, + COLOR_CHERRY, + COLOR_CHERRY_BLOSSOM_PINK, + COLOR_CHESTNUT, + COLOR_CHINA_PINK, + COLOR_CHINA_ROSE, + COLOR_CHINESE_RED, + COLOR_CHOCOLATE_TRADITIONAL, + COLOR_CHOCOLATE_WEB, + COLOR_CHROME_YELLOW, + COLOR_CINEREOUS, + COLOR_CINNABAR, + COLOR_CINNAMON, + COLOR_CITRINE, + COLOR_CLASSIC_ROSE, + COLOR_COBALT, + COLOR_COCOA_BROWN, + COLOR_COFFEE, + COLOR_COLUMBIA_BLUE, + COLOR_CONGO_PINK, + COLOR_COOL_BLACK, + COLOR_COOL_GREY, + COLOR_COPPER, + COLOR_COPPER_CRAYOLA, + COLOR_COPPER_PENNY, + COLOR_COPPER_RED, + COLOR_COPPER_ROSE, + COLOR_COQUELICOT, + COLOR_CORAL, + COLOR_CORAL_PINK, + COLOR_CORAL_RED, + COLOR_CORDOVAN, + COLOR_CORN, + COLOR_CORNELL_RED, + COLOR_CORNFLOWER_BLUE, + COLOR_CORNSILK, + COLOR_COSMIC_LATTE, + COLOR_COTTON_CANDY, + COLOR_CREAM, + COLOR_CRIMSON, + COLOR_CRIMSON_GLORY, + COLOR_CYAN, + COLOR_CYAN_PROCESS, + COLOR_DAFFODIL, + COLOR_DANDELION, + COLOR_DARK_BLUE, + COLOR_DARK_BROWN, + COLOR_DARK_BYZANTIUM, + COLOR_DARK_CANDY_APPLE_RED, + COLOR_DARK_CERULEAN, + COLOR_DARK_CHESTNUT, + COLOR_DARK_CORAL, + COLOR_DARK_CYAN, + COLOR_DARK_ELECTRIC_BLUE, + COLOR_DARK_GOLDENROD, + COLOR_DARK_GRAY, + COLOR_DARK_GREEN, + COLOR_DARK_IMPERIAL_BLUE, + COLOR_DARK_JUNGLE_GREEN, + COLOR_DARK_KHAKI, + COLOR_DARK_LAVA, + COLOR_DARK_LAVENDER, + COLOR_DARK_MAGENTA, + COLOR_DARK_MIDNIGHT_BLUE, + COLOR_DARK_OLIVE_GREEN, + COLOR_DARK_ORANGE, + COLOR_DARK_ORCHID, + COLOR_DARK_PASTEL_BLUE, + COLOR_DARK_PASTEL_GREEN, + COLOR_DARK_PASTEL_PURPLE, + COLOR_DARK_PASTEL_RED, + COLOR_DARK_PINK, + COLOR_DARK_POWDER_BLUE, + COLOR_DARK_RASPBERRY, + COLOR_DARK_RED, + COLOR_DARK_SALMON, + COLOR_DARK_SCARLET, + COLOR_DARK_SEA_GREEN, + COLOR_DARK_SIENNA, + COLOR_DARK_SLATE_BLUE, + COLOR_DARK_SLATE_GRAY, + COLOR_DARK_SPRING_GREEN, + COLOR_DARK_TAN, + COLOR_DARK_TANGERINE, + COLOR_DARK_TAUPE, + COLOR_DARK_TERRA_COTTA, + COLOR_DARK_TURQUOISE, + COLOR_DARK_VIOLET, + COLOR_DARK_YELLOW, + COLOR_DARTMOUTH_GREEN, + COLOR_DAVY_S_GREY, + COLOR_DEBIAN_RED, + COLOR_DEEP_CARMINE, + COLOR_DEEP_CARMINE_PINK, + COLOR_DEEP_CARROT_ORANGE, + COLOR_DEEP_CERISE, + COLOR_DEEP_CHAMPAGNE, + COLOR_DEEP_CHESTNUT, + COLOR_DEEP_COFFEE, + COLOR_DEEP_FUCHSIA, + COLOR_DEEP_JUNGLE_GREEN, + COLOR_DEEP_LILAC, + COLOR_DEEP_MAGENTA, + COLOR_DEEP_PEACH, + COLOR_DEEP_PINK, + COLOR_DEEP_RUBY, + COLOR_DEEP_SAFFRON, + COLOR_DEEP_SKY_BLUE, + COLOR_DEEP_TUSCAN_RED, + COLOR_DENIM, + COLOR_DESERT, + COLOR_DESERT_SAND, + COLOR_DIM_GRAY, + COLOR_DODGER_BLUE, + COLOR_DOGWOOD_ROSE, + COLOR_DOLLAR_BILL, + COLOR_DRAB, + COLOR_DUKE_BLUE, + COLOR_EARTH_YELLOW, + COLOR_EBONY, + COLOR_ECRU, + COLOR_EGGPLANT, + COLOR_EGGSHELL, + COLOR_EGYPTIAN_BLUE, + COLOR_ELECTRIC_BLUE, + COLOR_ELECTRIC_CRIMSON, + COLOR_ELECTRIC_CYAN, + COLOR_ELECTRIC_GREEN, + COLOR_ELECTRIC_INDIGO, + COLOR_ELECTRIC_LAVENDER, + COLOR_ELECTRIC_LIME, + COLOR_ELECTRIC_PURPLE, + COLOR_ELECTRIC_ULTRAMARINE, + COLOR_ELECTRIC_VIOLET, + COLOR_ELECTRIC_YELLOW, + COLOR_EMERALD, + COLOR_ENGLISH_LAVENDER, + COLOR_ETON_BLUE, + COLOR_FALLOW, + COLOR_FALU_RED, + COLOR_FANDANGO, + COLOR_FASHION_FUCHSIA, + COLOR_FAWN, + COLOR_FELDGRAU, + COLOR_FERN_GREEN, + COLOR_FERRARI_RED, + COLOR_FIELD_DRAB, + COLOR_FIRE_ENGINE_RED, + COLOR_FIREBRICK, + COLOR_FLAME, + COLOR_FLAMINGO_PINK, + COLOR_FLAVESCENT, + COLOR_FLAX, + COLOR_FLORAL_WHITE, + COLOR_FLUORESCENT_ORANGE, + COLOR_FLUORESCENT_PINK, + COLOR_FLUORESCENT_YELLOW, + COLOR_FOLLY, + COLOR_FOREST_GREEN_TRADITIONAL, + COLOR_FOREST_GREEN_WEB, + COLOR_FRENCH_BEIGE, + COLOR_FRENCH_BLUE, + COLOR_FRENCH_LILAC, + COLOR_FRENCH_LIME, + COLOR_FRENCH_RASPBERRY, + COLOR_FRENCH_ROSE, + COLOR_FUCHSIA, + COLOR_FUCHSIA_CRAYOLA, + COLOR_FUCHSIA_PINK, + COLOR_FUCHSIA_ROSE, + COLOR_FULVOUS, + COLOR_FUZZY_WUZZY, + COLOR_GAINSBORO, + COLOR_GAMBOGE, + COLOR_GHOST_WHITE, + COLOR_GINGER, + COLOR_GLAUCOUS, + COLOR_GLITTER, + COLOR_GOLD_METALLIC, + COLOR_GOLD_WEB_GOLDEN, + COLOR_GOLDEN_BROWN, + COLOR_GOLDEN_POPPY, + COLOR_GOLDEN_YELLOW, + COLOR_GOLDENROD, + COLOR_GRANNY_SMITH_APPLE, + COLOR_GRAY, + COLOR_GRAY_ASPARAGUS, + COLOR_GRAY_HTML_CSS_GRAY, + COLOR_GRAY_X11_GRAY, + COLOR_GREEN_COLOR_WHEEL_X11_GREEN, + COLOR_GREEN_CRAYOLA, + COLOR_GREEN_HTML_CSS_GREEN, + COLOR_GREEN_MUNSELL, + COLOR_GREEN_NCS, + COLOR_GREEN_PIGMENT, + COLOR_GREEN_RYB, + COLOR_GREEN_YELLOW, + COLOR_GRULLO, + COLOR_GUPPIE_GREEN, + COLOR_HALAY_BE, + COLOR_HAN_BLUE, + COLOR_HAN_PURPLE, + COLOR_HANSA_YELLOW, + COLOR_HARLEQUIN, + COLOR_HARVARD_CRIMSON, + COLOR_HARVEST_GOLD, + COLOR_HEART_GOLD, + COLOR_HELIOTROPE, + COLOR_HOLLYWOOD_CERISE, + COLOR_HONEYDEW, + COLOR_HONOLULU_BLUE, + COLOR_HOOKER_S_GREEN, + COLOR_HOT_MAGENTA, + COLOR_HOT_PINK, + COLOR_HUNTER_GREEN, + COLOR_ICEBERG, + COLOR_ICTERINE, + COLOR_IMPERIAL_BLUE, + COLOR_INCHWORM, + COLOR_INDIA_GREEN, + COLOR_INDIAN_RED, + COLOR_INDIAN_YELLOW, + COLOR_INDIGO, + COLOR_INDIGO_DYE, + COLOR_INDIGO_WEB, + COLOR_INTERNATIONAL_KLEIN_BLUE, + COLOR_INTERNATIONAL_ORANGE_AEROSPACE, + COLOR_INTERNATIONAL_ORANGE_ENGINEERING, + COLOR_INTERNATIONAL_ORANGE_GOLDEN_GATE_BRIDGE, + COLOR_IRIS, + COLOR_ISABELLINE, + COLOR_ISLAMIC_GREEN, + COLOR_IVORY, + COLOR_JADE, + COLOR_JASMINE, + COLOR_JASPER, + COLOR_JAZZBERRY_JAM, + COLOR_JET, + COLOR_JONQUIL, + COLOR_JUNE_BUD, + COLOR_JUNGLE_GREEN, + COLOR_KELLY_GREEN, + COLOR_KENYAN_COPPER, + COLOR_KHAKI_HTML_CSS_KHAKI, + COLOR_KHAKI_X11_LIGHT_KHAKI, + COLOR_KU_CRIMSON, + COLOR_LA_SALLE_GREEN, + COLOR_LANGUID_LAVENDER, + COLOR_LAPIS_LAZULI, + COLOR_LASER_LEMON, + COLOR_LAUREL_GREEN, + COLOR_LAVA, + COLOR_LAVENDER_BLUE, + COLOR_LAVENDER_BLUSH, + COLOR_LAVENDER_FLORAL, + COLOR_LAVENDER_GRAY, + COLOR_LAVENDER_INDIGO, + COLOR_LAVENDER_MAGENTA, + COLOR_LAVENDER_MIST, + COLOR_LAVENDER_PINK, + COLOR_LAVENDER_PURPLE, + COLOR_LAVENDER_ROSE, + COLOR_LAVENDER_WEB, + COLOR_LAWN_GREEN, + COLOR_LEMON, + COLOR_LEMON_CHIFFON, + COLOR_LEMON_LIME, + COLOR_LICORICE, + COLOR_LIGHT_APRICOT, + COLOR_LIGHT_BLUE, + COLOR_LIGHT_BROWN, + COLOR_LIGHT_CARMINE_PINK, + COLOR_LIGHT_CORAL, + COLOR_LIGHT_CORNFLOWER_BLUE, + COLOR_LIGHT_CRIMSON, + COLOR_LIGHT_CYAN, + COLOR_LIGHT_FUCHSIA_PINK, + COLOR_LIGHT_GOLDENROD_YELLOW, + COLOR_LIGHT_GRAY, + COLOR_LIGHT_GREEN, + COLOR_LIGHT_KHAKI, + COLOR_LIGHT_PASTEL_PURPLE, + COLOR_LIGHT_PINK, + COLOR_LIGHT_RED_OCHRE, + COLOR_LIGHT_SALMON, + COLOR_LIGHT_SALMON_PINK, + COLOR_LIGHT_SEA_GREEN, + COLOR_LIGHT_SKY_BLUE, + COLOR_LIGHT_SLATE_GRAY, + COLOR_LIGHT_TAUPE, + COLOR_LIGHT_THULIAN_PINK, + COLOR_LIGHT_YELLOW, + COLOR_LILAC, + COLOR_LIME_COLOR_WHEEL, + COLOR_LIME_GREEN, + COLOR_LIME_WEB_X11_GREEN, + COLOR_LIMERICK, + COLOR_LINCOLN_GREEN, + COLOR_LINEN, + COLOR_LION, + COLOR_LITTLE_BOY_BLUE, + COLOR_LIVER, + COLOR_LUST, + COLOR_MAGENTA, + COLOR_MAGENTA_DYE, + COLOR_MAGENTA_PROCESS, + COLOR_MAGIC_MINT, + COLOR_MAGNOLIA, + COLOR_MAHOGANY, + COLOR_MAIZE, + COLOR_MAJORELLE_BLUE, + COLOR_MALACHITE, + COLOR_MANATEE, + COLOR_MANGO_TANGO, + COLOR_MANTIS, + COLOR_MARDI_GRAS, + COLOR_MAROON_CRAYOLA, + COLOR_MAROON_HTML_CSS, + COLOR_MAROON_X11, + COLOR_MAUVE, + COLOR_MAUVE_TAUPE, + COLOR_MAUVELOUS, + COLOR_MAYA_BLUE, + COLOR_MEAT_BROWN, + COLOR_MEDIUM_AQUAMARINE, + COLOR_MEDIUM_BLUE, + COLOR_MEDIUM_CANDY_APPLE_RED, + COLOR_MEDIUM_CARMINE, + COLOR_MEDIUM_CHAMPAGNE, + COLOR_MEDIUM_ELECTRIC_BLUE, + COLOR_MEDIUM_JUNGLE_GREEN, + COLOR_MEDIUM_LAVENDER_MAGENTA, + COLOR_MEDIUM_ORCHID, + COLOR_MEDIUM_PERSIAN_BLUE, + COLOR_MEDIUM_PURPLE, + COLOR_MEDIUM_RED_VIOLET, + COLOR_MEDIUM_RUBY, + COLOR_MEDIUM_SEA_GREEN, + COLOR_MEDIUM_SLATE_BLUE, + COLOR_MEDIUM_SPRING_BUD, + COLOR_MEDIUM_SPRING_GREEN, + COLOR_MEDIUM_TAUPE, + COLOR_MEDIUM_TURQUOISE, + COLOR_MEDIUM_TUSCAN_RED, + COLOR_MEDIUM_VERMILION, + COLOR_MEDIUM_VIOLET_RED, + COLOR_MELLOW_APRICOT, + COLOR_MELLOW_YELLOW, + COLOR_MELON, + COLOR_MIDNIGHT_BLUE, + COLOR_MIDNIGHT_GREEN_EAGLE_GREEN, + COLOR_MIKADO_YELLOW, + COLOR_MINT, + COLOR_MINT_CREAM, + COLOR_MINT_GREEN, + COLOR_MISTY_ROSE, + COLOR_MOCCASIN, + COLOR_MODE_BEIGE, + COLOR_MOONSTONE_BLUE, + COLOR_MORDANT_RED_19, + COLOR_MOSS_GREEN, + COLOR_MOUNTAIN_MEADOW, + COLOR_MOUNTBATTEN_PINK, + COLOR_MSU_GREEN, + COLOR_MULBERRY, + COLOR_MUSTARD, + COLOR_MYRTLE, + COLOR_NADESHIKO_PINK, + COLOR_NAPIER_GREEN, + COLOR_NAPLES_YELLOW, + COLOR_NAVAJO_WHITE, + COLOR_NAVY_BLUE, + COLOR_NEON_CARROT, + COLOR_NEON_FUCHSIA, + COLOR_NEON_GREEN, + COLOR_NEW_YORK_PINK, + COLOR_NON_PHOTO_BLUE, + COLOR_NORTH_TEXAS_GREEN, + COLOR_OCEAN_BOAT_BLUE, + COLOR_OCHRE, + COLOR_OFFICE_GREEN, + COLOR_OLD_GOLD, + COLOR_OLD_LACE, + COLOR_OLD_LAVENDER, + COLOR_OLD_MAUVE, + COLOR_OLD_ROSE, + COLOR_OLIVE, + COLOR_OLIVE_DRAB_7, + COLOR_OLIVE_DRAB_WEB_OLIVE_DRAB_3, + COLOR_OLIVINE, + COLOR_ONYX, + COLOR_OPERA_MAUVE, + COLOR_ORANGE_COLOR_WHEEL, + COLOR_ORANGE_PEEL, + COLOR_ORANGE_RED, + COLOR_ORANGE_RYB, + COLOR_ORANGE_WEB_COLOR, + COLOR_ORCHID, + COLOR_OTTER_BROWN, + COLOR_OU_CRIMSON_RED, + COLOR_OUTER_SPACE, + COLOR_OUTRAGEOUS_ORANGE, + COLOR_OXFORD_BLUE, + COLOR_PAKISTAN_GREEN, + COLOR_PALATINATE_BLUE, + COLOR_PALATINATE_PURPLE, + COLOR_PALE_AQUA, + COLOR_PALE_BLUE, + COLOR_PALE_BROWN, + COLOR_PALE_CARMINE, + COLOR_PALE_CERULEAN, + COLOR_PALE_CHESTNUT, + COLOR_PALE_COPPER, + COLOR_PALE_CORNFLOWER_BLUE, + COLOR_PALE_GOLD, + COLOR_PALE_GOLDENROD, + COLOR_PALE_GREEN, + COLOR_PALE_LAVENDER, + COLOR_PALE_MAGENTA, + COLOR_PALE_PINK, + COLOR_PALE_PLUM, + COLOR_PALE_RED_VIOLET, + COLOR_PALE_ROBIN_EGG_BLUE, + COLOR_PALE_SILVER, + COLOR_PALE_SPRING_BUD, + COLOR_PALE_TAUPE, + COLOR_PALE_VIOLET_RED, + COLOR_PANSY_PURPLE, + COLOR_PAPAYA_WHIP, + COLOR_PARIS_GREEN, + COLOR_PASTEL_BLUE, + COLOR_PASTEL_BROWN, + COLOR_PASTEL_GRAY, + COLOR_PASTEL_GREEN, + COLOR_PASTEL_MAGENTA, + COLOR_PASTEL_ORANGE, + COLOR_PASTEL_PINK, + COLOR_PASTEL_PURPLE, + COLOR_PASTEL_RED, + COLOR_PASTEL_VIOLET, + COLOR_PASTEL_YELLOW, + COLOR_PATRIARCH, + COLOR_PAYNE_S_GREY, + COLOR_PEACH, + COLOR_PEACH_CRAYOLA, + COLOR_PEACH_ORANGE, + COLOR_PEACH_PUFF, + COLOR_PEACH_YELLOW, + COLOR_PEAR, + COLOR_PEARL, + COLOR_PEARL_AQUA, + COLOR_PEARLY_PURPLE, + COLOR_PERIDOT, + COLOR_PERIWINKLE, + COLOR_PERSIAN_BLUE, + COLOR_PERSIAN_GREEN, + COLOR_PERSIAN_INDIGO, + COLOR_PERSIAN_ORANGE, + COLOR_PERSIAN_PINK, + COLOR_PERSIAN_PLUM, + COLOR_PERSIAN_RED, + COLOR_PERSIAN_ROSE, + COLOR_PERSIMMON, + COLOR_PERU, + COLOR_PHLOX, + COLOR_PHTHALO_BLUE, + COLOR_PHTHALO_GREEN, + COLOR_PIGGY_PINK, + COLOR_PINE_GREEN, + COLOR_PINK, + COLOR_PINK_LACE, + COLOR_PINK_ORANGE, + COLOR_PINK_PEARL, + COLOR_PINK_SHERBET, + COLOR_PISTACHIO, + COLOR_PLATINUM, + COLOR_PLUM_TRADITIONAL, + COLOR_PLUM_WEB, + COLOR_PORTLAND_ORANGE, + COLOR_POWDER_BLUE_WEB, + COLOR_PRINCETON_ORANGE, + COLOR_PRUNE, + COLOR_PRUSSIAN_BLUE, + COLOR_PSYCHEDELIC_PURPLE, + COLOR_PUCE, + COLOR_PUMPKIN, + COLOR_PURPLE_HEART, + COLOR_PURPLE_HTML_CSS, + COLOR_PURPLE_MOUNTAIN_MAJESTY, + COLOR_PURPLE_MUNSELL, + COLOR_PURPLE_PIZZAZZ, + COLOR_PURPLE_TAUPE, + COLOR_PURPLE_X11, + COLOR_QUARTZ, + COLOR_RACKLEY, + COLOR_RADICAL_RED, + COLOR_RAJAH, + COLOR_RASPBERRY, + COLOR_RASPBERRY_GLACE, + COLOR_RASPBERRY_PINK, + COLOR_RASPBERRY_ROSE, + COLOR_RAW_UMBER, + COLOR_RAZZLE_DAZZLE_ROSE, + COLOR_RAZZMATAZZ, + COLOR_RED, + COLOR_RED_BROWN, + COLOR_RED_DEVIL, + COLOR_RED_MUNSELL, + COLOR_RED_NCS, + COLOR_RED_ORANGE, + COLOR_RED_PIGMENT, + COLOR_RED_RYB, + COLOR_RED_VIOLET, + COLOR_REDWOOD, + COLOR_REGALIA, + COLOR_RESOLUTION_BLUE, + COLOR_RICH_BLACK, + COLOR_RICH_BRILLIANT_LAVENDER, + COLOR_RICH_CARMINE, + COLOR_RICH_ELECTRIC_BLUE, + COLOR_RICH_LAVENDER, + COLOR_RICH_LILAC, + COLOR_RICH_MAROON, + COLOR_RIFLE_GREEN, + COLOR_ROBIN_EGG_BLUE, + COLOR_ROSE, + COLOR_ROSE_BONBON, + COLOR_ROSE_EBONY, + COLOR_ROSE_GOLD, + COLOR_ROSE_MADDER, + COLOR_ROSE_PINK, + COLOR_ROSE_QUARTZ, + COLOR_ROSE_TAUPE, + COLOR_ROSE_VALE, + COLOR_ROSEWOOD, + COLOR_ROSSO_CORSA, + COLOR_ROSY_BROWN, + COLOR_ROYAL_AZURE, + COLOR_ROYAL_BLUE_TRADITIONAL, + COLOR_ROYAL_BLUE_WEB, + COLOR_ROYAL_FUCHSIA, + COLOR_ROYAL_PURPLE, + COLOR_ROYAL_YELLOW, + COLOR_RUBINE_RED, + COLOR_RUBY, + COLOR_RUBY_RED, + COLOR_RUDDY, + COLOR_RUDDY_BROWN, + COLOR_RUDDY_PINK, + COLOR_RUFOUS, + COLOR_RUSSET, + COLOR_RUST, + COLOR_RUSTY_RED, + COLOR_SACRAMENTO_STATE_GREEN, + COLOR_SADDLE_BROWN, + COLOR_SAFETY_ORANGE_BLAZE_ORANGE, + COLOR_SAFFRON, + COLOR_SALMON, + COLOR_SALMON_PINK, + COLOR_SAND, + COLOR_SAND_DUNE, + COLOR_SANDSTORM, + COLOR_SANDY_BROWN, + COLOR_SANDY_TAUPE, + COLOR_SANGRIA, + COLOR_SAP_GREEN, + COLOR_SAPPHIRE, + COLOR_SAPPHIRE_BLUE, + COLOR_SATIN_SHEEN_GOLD, + COLOR_SCARLET, + COLOR_SCARLET_CRAYOLA, + COLOR_SCHOOL_BUS_YELLOW, + COLOR_SCREAMIN_GREEN, + COLOR_SEA_BLUE, + COLOR_SEA_GREEN, + COLOR_SEAL_BROWN, + COLOR_SEASHELL, + COLOR_SELECTIVE_YELLOW, + COLOR_SEPIA, + COLOR_SHADOW, + COLOR_SHAMROCK_GREEN, + COLOR_SHOCKING_PINK, + COLOR_SHOCKING_PINK_CRAYOLA, + COLOR_SIENNA, + COLOR_SILVER, + COLOR_SINOPIA, + COLOR_SKOBELOFF, + COLOR_SKY_BLUE, + COLOR_SKY_MAGENTA, + COLOR_SLATE_BLUE, + COLOR_SLATE_GRAY, + COLOR_SMALT_DARK_POWDER_BLUE, + COLOR_SMOKEY_TOPAZ, + COLOR_SMOKY_BLACK, + COLOR_SNOW, + COLOR_SPIRO_DISCO_BALL, + COLOR_SPRING_BUD, + COLOR_SPRING_GREEN, + COLOR_ST_PATRICK_S_BLUE, + COLOR_STEEL_BLUE, + COLOR_STIL_DE_GRAIN_YELLOW, + COLOR_STIZZA, + COLOR_STORMCLOUD, + COLOR_STRAW, + COLOR_SUNGLOW, + COLOR_SUNSET, + COLOR_TAN, + COLOR_TANGELO, + COLOR_TANGERINE, + COLOR_TANGERINE_YELLOW, + COLOR_TANGO_PINK, + COLOR_TAUPE, + COLOR_TAUPE_GRAY, + COLOR_TEA_GREEN, + COLOR_TEA_ROSE_ORANGE, + COLOR_TEA_ROSE_ROSE, + COLOR_TEAL, + COLOR_TEAL_BLUE, + COLOR_TEAL_GREEN, + COLOR_TELEMAGENTA, + COLOR_TENN_TAWNY, + COLOR_TERRA_COTTA, + COLOR_THISTLE, + COLOR_THULIAN_PINK, + COLOR_TICKLE_ME_PINK, + COLOR_TIFFANY_BLUE, + COLOR_TIGER_S_EYE, + COLOR_TIMBERWOLF, + COLOR_TITANIUM_YELLOW, + COLOR_TOMATO, + COLOR_TOOLBOX, + COLOR_TOPAZ, + COLOR_TRACTOR_RED, + COLOR_TROLLEY_GREY, + COLOR_TROPICAL_RAIN_FOREST, + COLOR_TRUE_BLUE, + COLOR_TUFTS_BLUE, + COLOR_TUMBLEWEED, + COLOR_TURKISH_ROSE, + COLOR_TURQUOISE, + COLOR_TURQUOISE_BLUE, + COLOR_TURQUOISE_GREEN, + COLOR_TUSCAN_RED, + COLOR_TWILIGHT_LAVENDER, + COLOR_TYRIAN_PURPLE, + COLOR_UA_BLUE, + COLOR_UA_RED, + COLOR_UBE, + COLOR_UCLA_BLUE, + COLOR_UCLA_GOLD, + COLOR_UFO_GREEN, + COLOR_ULTRA_PINK, + COLOR_ULTRAMARINE, + COLOR_ULTRAMARINE_BLUE, + COLOR_UMBER, + COLOR_UNBLEACHED_SILK, + COLOR_UNITED_NATIONS_BLUE, + COLOR_UNIVERSITY_OF_CALIFORNIA_GOLD, + COLOR_UNMELLOW_YELLOW, + COLOR_UP_FOREST_GREEN, + COLOR_UP_MAROON, + COLOR_UPSDELL_RED, + COLOR_UROBILIN, + COLOR_USAFA_BLUE, + COLOR_USC_CARDINAL, + COLOR_USC_GOLD, + COLOR_UTAH_CRIMSON, + COLOR_VANILLA, + COLOR_VEGAS_GOLD, + COLOR_VENETIAN_RED, + COLOR_VERDIGRIS, + COLOR_VERMILION_CINNABAR, + COLOR_VERMILION_PLOCHERE, + COLOR_VERONICA, + COLOR_VIOLET, + COLOR_VIOLET_BLUE, + COLOR_VIOLET_COLOR_WHEEL, + COLOR_VIOLET_RYB, + COLOR_VIOLET_WEB, + COLOR_VIRIDIAN, + COLOR_VIVID_AUBURN, + COLOR_VIVID_BURGUNDY, + COLOR_VIVID_CERISE, + COLOR_VIVID_TANGERINE, + COLOR_VIVID_VIOLET, + COLOR_WARM_BLACK, + COLOR_WATERSPOUT, + COLOR_WENGE, + COLOR_WHEAT, + COLOR_WHITE, + COLOR_WHITE_SMOKE, + COLOR_WILD_BLUE_YONDER, + COLOR_WILD_STRAWBERRY, + COLOR_WILD_WATERMELON, + COLOR_WINE, + COLOR_WINE_DREGS, + COLOR_WISTERIA, + COLOR_WOOD_BROWN, + COLOR_XANADU, + COLOR_YALE_BLUE, + COLOR_YELLOW, + COLOR_YELLOW_GREEN, + COLOR_YELLOW_MUNSELL, + COLOR_YELLOW_NCS, + COLOR_YELLOW_ORANGE, + COLOR_YELLOW_PROCESS, + COLOR_YELLOW_RYB, + COLOR_ZAFFRE, + COLOR_ZINNWALDITE_BROWN, + -1 +}; + +const int TestColors[] = { + COLOR_RED, + COLOR_ELECTRIC_GREEN, + COLOR_BLUE, + -1 +}; + +const int Electrics[] = { + COLOR_ELECTRIC_BLUE, + COLOR_ELECTRIC_CRIMSON, + COLOR_ELECTRIC_CYAN, + COLOR_ELECTRIC_GREEN, + COLOR_ELECTRIC_INDIGO, + COLOR_ELECTRIC_LAVENDER, + COLOR_ELECTRIC_LIME, + COLOR_ELECTRIC_PURPLE, + COLOR_ELECTRIC_ULTRAMARINE, + COLOR_ELECTRIC_VIOLET, + -1 +}; + +const int Reds[] = { + COLOR_BARN_RED, + COLOR_BOSTON_UNIVERSITY_RED, + COLOR_BRICK_RED, + COLOR_CADMIUM_RED, + COLOR_CANDY_APPLE_RED, + COLOR_CARMINE_RED, + COLOR_CHINESE_RED, + COLOR_COPPER_RED, + COLOR_CORAL_RED, + COLOR_DARK_RED, + COLOR_RED, + COLOR_RED_BROWN, + COLOR_RED_DEVIL, + COLOR_RED_MUNSELL, + COLOR_RED_NCS, + COLOR_RED_ORANGE, + COLOR_RED_PIGMENT, + COLOR_RED_RYB, + COLOR_RED_VIOLET, + -1 +}; + +const int Greens[] = { + COLOR_KELLY_GREEN, + COLOR_LAWN_GREEN, + COLOR_LIME_GREEN, + COLOR_ANDROID_GREEN, + COLOR_APPLE_GREEN, + COLOR_ARMY_GREEN, + COLOR_BOTTLE_GREEN, + COLOR_BRIGHT_GREEN, + COLOR_GREEN_COLOR_WHEEL_X11_GREEN, + COLOR_GREEN_CRAYOLA, + COLOR_GREEN_HTML_CSS_GREEN, + COLOR_GREEN_MUNSELL, + COLOR_GREEN_NCS, + COLOR_GREEN_PIGMENT, + COLOR_GREEN_RYB, + -1 +}; + +const int Blues[] = { + COLOR_AIR_FORCE_BLUE_USAF, + COLOR_AIR_SUPERIORITY_BLUE, + COLOR_ALICE_BLUE, + COLOR_BLIZZARD_BLUE, + COLOR_BLUE, + COLOR_BLUE_BELL, + COLOR_BLUE_CRAYOLA, + COLOR_BLUE_GRAY, + COLOR_BLUE_GREEN, + COLOR_BLUE_MUNSELL, + COLOR_BLUE_NCS, + COLOR_BLUE_PIGMENT, + COLOR_BLUE_RYB, + COLOR_BLUE_SAPPHIRE, + COLOR_BLUE_VIOLET, + COLOR_BRANDEIS_BLUE, + COLOR_CADET_BLUE, + COLOR_CAMBRIDGE_BLUE, + COLOR_CAROLINA_BLUE, + -1 +}; + +const int Purples[] = { + COLOR_PURPLE_HEART, + COLOR_PURPLE_HTML_CSS, + COLOR_PURPLE_MOUNTAIN_MAJESTY, + COLOR_PURPLE_MUNSELL, + COLOR_PURPLE_PIZZAZZ, + COLOR_PURPLE_TAUPE, + COLOR_PURPLE_X11, + COLOR_VIOLET, + COLOR_VIOLET_BLUE, + COLOR_VIOLET_COLOR_WHEEL, + COLOR_VIOLET_RYB, + COLOR_VIOLET_WEB, + COLOR_ROYAL_PURPLE, + COLOR_ELECTRIC_PURPLE, + COLOR_PSYCHEDELIC_PURPLE, + -1 +}; + + +const int Pastels[] = { + COLOR_PASTEL_BLUE, + COLOR_PASTEL_BROWN, + COLOR_PASTEL_GRAY, + COLOR_PASTEL_GREEN, + COLOR_PASTEL_MAGENTA, + COLOR_PASTEL_ORANGE, + COLOR_PASTEL_PINK, + COLOR_PASTEL_PURPLE, + COLOR_PASTEL_RED, + COLOR_PASTEL_VIOLET, + COLOR_PASTEL_YELLOW, + -1 +}; + +const int GoodYellows[] = { + COLOR_YELLOW, + COLOR_BANANA_YELLOW, + COLOR_CANARY_YELLOW, + COLOR_ELECTRIC_YELLOW, + COLOR_FLUORESCENT_YELLOW, + COLOR_LIGHT_YELLOW, + COLOR_GOLDEN_YELLOW, + COLOR_SCHOOL_BUS_YELLOW, + -1 +}; + +const int OneYellow[] = { + COLOR_YELLOW, + -1 +}; + +const int DarkYellows[] = { + COLOR_DARK_YELLOW, + COLOR_ROYAL_YELLOW, + COLOR_GOLDEN_YELLOW, + -1 +}; + +const int Yellows[] = { + COLOR_ARYLIDE_YELLOW, + COLOR_BANANA_YELLOW, + COLOR_CADMIUM_YELLOW, + COLOR_CANARY_YELLOW, + COLOR_CHROME_YELLOW, + COLOR_DARK_YELLOW, + COLOR_EARTH_YELLOW, + COLOR_ELECTRIC_YELLOW, + COLOR_FLUORESCENT_YELLOW, + COLOR_GOLDEN_YELLOW, + COLOR_HANSA_YELLOW, + COLOR_INDIAN_YELLOW, + COLOR_MELLOW_YELLOW, + COLOR_MIKADO_YELLOW, + COLOR_NAPLES_YELLOW, + COLOR_PASTEL_YELLOW, + COLOR_PEACH_YELLOW, + COLOR_ROYAL_YELLOW, + COLOR_SCHOOL_BUS_YELLOW, + COLOR_SELECTIVE_YELLOW, + COLOR_STIL_DE_GRAIN_YELLOW, + COLOR_TANGERINE_YELLOW, + COLOR_TITANIUM_YELLOW, + COLOR_UNMELLOW_YELLOW, + COLOR_YELLOW, + COLOR_YELLOW_MUNSELL, + COLOR_YELLOW_NCS, + COLOR_YELLOW_ORANGE, + COLOR_YELLOW_PROCESS, + COLOR_YELLOW_RYB, + -1 + }; + +const int KulorYellowShades[] = { + KULOR_YELLOW_SHADES1, + KULOR_YELLOW_SHADES2, + KULOR_YELLOW_SHADES3, + KULOR_YELLOW_SHADES4, + KULOR_YELLOW_SHADES5, + -1 +}; + +const int Black[] = { + COLOR_BLACK, + -1 +}; + + +#define BASE_COLOR_LIST_SIZE 4 +const int* baseColors[] = { + DarkYellows, + Yellows, + GoodYellows, + KulorYellowShades +}; + +#define MOVEMENT_COLOR_LIST_SIZE 9 +const int* movementColors[] = { + All, + TestColors, + Electrics, + Pastels, + Purples, + Blues, + Greens, + Reds, + KulorSunsetCamping +}; + +// NOTE: Make sure first two chars are unique. Done to save typing +#define USER_COLOR_CHOICES_SIZE 13 +const ColorListInfo listOfColorLists[] = { + { "all", All }, + { "testColors", TestColors }, + { "electrics", Electrics }, + { "pastels", Pastels }, + { "purples", Purples }, + { "blues", Blues }, + { "greens", Greens }, + { "reds", Reds }, + { "sunsetKulor", KulorSunsetCamping }, + { "yellows", Yellows }, + { "darkYellows", DarkYellows }, + { "goodYellows", GoodYellows }, + { "shadesYellowKulor", KulorYellowShades }, +}; + +#endif \ No newline at end of file
diff -r 15764cc1f12c -r 73923b07ae4a gsCLockGenerator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsCLockGenerator.cpp Sat Jun 09 23:23:06 2018 +0000 @@ -0,0 +1,126 @@ +// https://devzone.nordicsemi.com/question/44628/maximum-clock-possible-on-gpio-pin-nrf51/ + +// Mbed doesn't support high speed clock output, so had to hack this using direct calls to the Nordic API + +#include "mbed.h" + +// Not to be confused with the output pin +#define GPIOTE_CHANNEL_NUMBER 0 + +/** + * @enum nrf_gpiote_polarity_t + * @brief Polarity for GPIOTE channel enumerator. + */ +typedef enum +{ + NRF_GPIOTE_POLARITY_LOTOHI = GPIOTE_CONFIG_POLARITY_LoToHi, ///< Low to high + NRF_GPIOTE_POLARITY_HITOLO = GPIOTE_CONFIG_POLARITY_HiToLo, ///< High to low + NRF_GPIOTE_POLARITY_TOGGLE = GPIOTE_CONFIG_POLARITY_Toggle ///< Toggle +} nrf_gpiote_polarity_t; + + + /** + * @enum nrf_gpiote_outinit_t + * @brief Initial output value for GPIOTE channel enumerator. + */ +typedef enum +{ + NRF_GPIOTE_INITIAL_VALUE_LOW = GPIOTE_CONFIG_OUTINIT_Low, ///< Low to high + NRF_GPIOTE_INITIAL_VALUE_HIGH = GPIOTE_CONFIG_OUTINIT_High ///< High to low +} nrf_gpiote_outinit_t; + + + +static void timer2_init() +{ + // Start 16 MHz crystal oscillator. + NRF_CLOCK->EVENTS_HFCLKSTARTED = 0; + NRF_CLOCK->TASKS_HFCLKSTART = 1; + + // Wait for the external oscillator to start up. + while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0) + { + // Do nothing. + } + NRF_TIMER2->MODE = TIMER_MODE_MODE_Timer; // Set the timer in Timer Mode. + NRF_TIMER2->PRESCALER = 0; + NRF_TIMER2->BITMODE = TIMER_BITMODE_BITMODE_16Bit; // 16 bit mode. + NRF_TIMER2->TASKS_CLEAR = 1; + NRF_TIMER2->CC[0] = 1; + NRF_TIMER2->EVENTS_COMPARE[0] = 0; + NRF_TIMER2->SHORTS = + (TIMER_SHORTS_COMPARE0_CLEAR_Enabled << TIMER_SHORTS_COMPARE0_CLEAR_Pos); +} + +static void ppi_init(void) +{ + // Configure PPI channel 0 to toggle GPIO_OUTPUT_PIN on every TIMER2 COMPARE[0] match (200 ms) + NRF_PPI->CH[0].EEP = (uint32_t)&NRF_TIMER2->EVENTS_COMPARE[0]; + NRF_PPI->CH[0].TEP = (uint32_t)&NRF_GPIOTE->TASKS_OUT[GPIOTE_CHANNEL_NUMBER]; + + // Enable PPI channel 0 + NRF_PPI->CHEN = (PPI_CHEN_CH0_Enabled << PPI_CHEN_CH0_Pos); +} + + +/** + * @brief Config GPIOTE channel as output, setting the properly desired output level. + * + * + * @param channel_number specifies the GPIOTE channel [0:3] to configure as an output channel. + * @param pin_number specifies the pin number [0:30] to use in the GPIOTE channel. + * @param polarity specifies the desired polarity in the output GPIOTE channel. + * @param initial_value specifies the initial value of the GPIOTE channel input after the channel configuration. + */ +static __INLINE void nrf_gpiote_task_config(uint32_t channel_number, uint32_t pin_number, nrf_gpiote_polarity_t polarity, nrf_gpiote_outinit_t initial_value) +{ + /* Check if the output desired is high or low */ + if (initial_value == NRF_GPIOTE_INITIAL_VALUE_LOW) + { + /* Configure channel to Pin31, not connected to the pin, and configure as a tasks that will set it to proper level */ + NRF_GPIOTE->CONFIG[channel_number] = (GPIOTE_CONFIG_MODE_Task << GPIOTE_CONFIG_MODE_Pos) | + (31UL << GPIOTE_CONFIG_PSEL_Pos) | + (GPIOTE_CONFIG_POLARITY_HiToLo << GPIOTE_CONFIG_POLARITY_Pos); + } + else + { + /* Configure channel to Pin31, not connected to the pin, and configure as a tasks that will set it to proper level */ + NRF_GPIOTE->CONFIG[channel_number] = (GPIOTE_CONFIG_MODE_Task << GPIOTE_CONFIG_MODE_Pos) | + (31UL << GPIOTE_CONFIG_PSEL_Pos) | + (GPIOTE_CONFIG_POLARITY_LoToHi << GPIOTE_CONFIG_POLARITY_Pos); + } + + /* Three NOPs are required to make sure configuration is written before setting tasks or getting events */ + __NOP(); + __NOP(); + __NOP(); + + /* Launch the task to take the GPIOTE channel output to the desired level */ + NRF_GPIOTE->TASKS_OUT[channel_number] = 1; + + /* Finally configure the channel as the caller expects. If OUTINIT works, the channel is configured properly. + If it does not, the channel output inheritance sets the proper level. */ + NRF_GPIOTE->CONFIG[channel_number] = (GPIOTE_CONFIG_MODE_Task << GPIOTE_CONFIG_MODE_Pos) | + ((uint32_t)pin_number << GPIOTE_CONFIG_PSEL_Pos) | + ((uint32_t)polarity << GPIOTE_CONFIG_POLARITY_Pos) | + ((uint32_t)initial_value << GPIOTE_CONFIG_OUTINIT_Pos); + + /* Three NOPs are required to make sure configuration is written before setting tasks or getting events */ + __NOP(); + __NOP(); + __NOP(); +} + +void init_clock(PinName clkPin) { + + // configure TIMER2 + timer2_init(); + + // configure PPI + ppi_init(); + + nrf_gpiote_task_config(GPIOTE_CHANNEL_NUMBER, clkPin, \ + NRF_GPIOTE_POLARITY_TOGGLE , NRF_GPIOTE_INITIAL_VALUE_LOW); + + NRF_TIMER2->TASKS_START = 1; // Start event generation. +} \ No newline at end of file
diff -r 15764cc1f12c -r 73923b07ae4a main.cpp --- a/main.cpp Tue Sep 29 12:02:15 2015 +0000 +++ b/main.cpp Sat Jun 09 23:23:06 2018 +0000 @@ -16,10 +16,17 @@ #include "mbed.h" #include "ble/BLE.h" - +#include "nrf_soc.h" // for internal temp sensor #include "ble/services/UARTService.h" +#include "TLC5955.h" +#include "sequencer.h" -#define NEED_CONSOLE_OUTPUT 0 /* Set this if you need debug messages on the console; +#include <ctype.h> + +#define INPUT_BUFFER_SIZE 256 + + +#define NEED_CONSOLE_OUTPUT 1 /* Set this if you need debug messages on the console; * it will have an impact on code-size and power consumption. */ #if NEED_CONSOLE_OUTPUT @@ -28,58 +35,513 @@ #define DEBUG(...) /* nothing */ #endif /* #if NEED_CONSOLE_OUTPUT */ -BLEDevice ble; -DigitalOut led1(LED1); +extern void Sequencer(); +extern void SequencerConfig(); +extern void setChannelToRGB(int channel, uint16_t r, uint16_t g, uint16_t b); +extern int getMode(); +extern void setMode(int mode); +extern uint32_t TheElapsedTime; + +extern uint16_t debugRedOut[(CHANNELS_PER_IC*NUMBER_OF_ICS)]; +extern uint16_t debugGreenOut[(CHANNELS_PER_IC*NUMBER_OF_ICS)]; +extern uint16_t debugBlueOut[(CHANNELS_PER_IC*NUMBER_OF_ICS)]; + +InterruptIn button1(P0_17); // button 1 on nRF51-DK. +InterruptIn button2(P0_18); // button 2 +InterruptIn button3(P0_19); // button 3 +InterruptIn button4(P0_20); // button 4 + +uint8_t lastAmplitude = 100; +uint8_t allRed=0; +uint8_t allGreen=0; +uint8_t allBlue=0; + +BLEDevice* ble; +TLC5955* theChip; UARTService *uartServicePtr; +// for use by string tokenizer. 10 tokens max +char* tokenList[10]; + +char inputBuffer[INPUT_BUFFER_SIZE]; +int inputBufferOffset = 0; +int lastProcessedOffset = 0; +int currentProcessedOffset = -1; +int dataToProcess = FALSE; + +extern uint16_t UserAdjustableMovementInterval; + void disconnectionCallback(const Gap::DisconnectionCallbackParams_t *params) { - DEBUG("Disconnected!\n\r"); - DEBUG("Restarting the advertising process\n\r"); - ble.startAdvertising(); + DEBUG("BLE Disconnected.\n\r"); + ble->startAdvertising(); +} + +void connectCallback(const Gap::ConnectionCallbackParams_t *params) +{ + DEBUG("BLE Connected.\n\r"); + ble->stopAdvertising(); } void onDataWritten(const GattWriteCallbackParams *params) { if ((uartServicePtr != NULL) && (params->handle == uartServicePtr->getTXCharacteristicHandle())) { uint16_t bytesRead = params->len; - DEBUG("received %u bytes\n\r", bytesRead); - ble.updateCharacteristicValue(uartServicePtr->getRXCharacteristicHandle(), params->data, bytesRead); + DEBUG("received %u bytes\n\r", bytesRead); + for (int i=0; i< bytesRead;i++) { + inputBuffer[inputBufferOffset] = params->data[i]; + if (inputBuffer[inputBufferOffset] == 13 || inputBuffer[inputBufferOffset] == 10) { + dataToProcess = TRUE; + lastProcessedOffset = currentProcessedOffset; + currentProcessedOffset = inputBufferOffset; + } + inputBufferOffset++; + inputBufferOffset = inputBufferOffset % INPUT_BUFFER_SIZE; + } } } +// limited to 20 chars +void writeToBLE(const uint8_t* text) { + ble->updateCharacteristicValue(uartServicePtr->getRXCharacteristicHandle(), text, strlen((char*)text)); +} + + void periodicCallback(void) { - led1 = !led1; + Sequencer(); +} + +int temperature_data_get(void) +{ + int32_t temp; + uint32_t err_code; + + err_code = sd_temp_get(&temp); + + // temp is recorded in 0.25C increments, accurate to +/-4 degrees + return (int) (temp / 4); + +} + +typedef enum { + STR2INT_SUCCESS, + STR2INT_OVERFLOW, + STR2INT_UNDERFLOW, + STR2INT_INCONVERTIBLE +} str2int_errno; + +/* +Convert string s to int out. + +@param[out] out The converted int. Cannot be NULL. + +@param[in] s Input string to be converted. + + The format is the same as strtol, + except that the following are inconvertible: + + - empty string + - leading whitespace + - any trailing characters that are not part of the number + + Cannot be NULL. + +@param[in] base Base to interpret string in. Same range as strtol (2 to 36). + +@return Indicates if the operation succeeded, or why it failed. +*/ +str2int_errno str2int(long *out, char *s, int base) { + char *end; + //printf("str2int: s=%s\n\r",s); + if (s[0] == '\0' || isspace((unsigned char) s[0])) + return STR2INT_INCONVERTIBLE; + //errno = 0; + long l = strtol(s, &end, base); + //printf("str2int: l=%ld\n\r", l); + /* Both checks are needed because INT_MAX == LONG_MAX is possible. */ + if (l > 65535 ) { + printf("Overflow.\n\r"); + return STR2INT_OVERFLOW; + } + if (l < 0 ) { + printf("Underflow.\n\r"); + return STR2INT_UNDERFLOW; + } + if (*end != '\0') { + printf("Inconvertible.\n\r"); + return STR2INT_INCONVERTIBLE; + } + printf("OK\n\r"); + *out = l; + return STR2INT_SUCCESS; +} + +// duplicate string +char* strdup ( char* s) { + char *d = (char*) malloc (strlen (s) + 1); // Space for length plus nul + if (d == NULL) return NULL; // No memory + strcpy (d,s); // Copy the characters + return d; // Return the new string +} + +// http://stackoverflow.com/questions/9210528/split-string-with-delimiters-in-c +char** str_split(char* a_str, char a_delim) +{ + //char** result = 0; + size_t count = 0; + char* tmp = a_str; + char* last_comma = 0; + char delim[2]; + delim[0] = a_delim; + delim[1] = 0; + + /* Count how many elements will be extracted. */ + while (*tmp) + { + if (a_delim == *tmp) + { + count++; + last_comma = tmp; + } + tmp++; + } + + /* Add space for trailing token. */ + count += last_comma < (a_str + strlen(a_str) - 1); + + /* Add space for terminating null string so caller + knows where the list of returned strings ends. */ + count++; + + //result = malloc(sizeof(char*) * count); + + + size_t idx = 0; + char* token = strtok(a_str, delim); + + while (token) + { + //assert(idx < count); + *(tokenList + idx++) = strdup(token); + token = strtok(0, delim); + } + //assert(idx == count - 1); + *(tokenList + idx) = 0; + + return tokenList; +} + +int getTokenCount(char** tokens) { + int i; + for (i=0; tokens[i] != 0;i++); + return i; +} + +void RemoveSpaces(char* source) +{ + char* i = source; + char* j = source; + while(*j != 0) + { + *i = *j++; + if(*i != ' ') + i++; + } + *i = 0; } + + +void parseInputData() { + char inputLine[256]; + char outputLine[256]; + int j=0; + long channel, r, g, b; + + for (int i=lastProcessedOffset+1; i != currentProcessedOffset; j++, i++) { + i = i % INPUT_BUFFER_SIZE; + inputLine[j] = tolower(inputBuffer[i]); + } + inputLine[j] = 0; + + RemoveSpaces(inputLine); + + // TODO: Define input command to set channel to color name or to R,G,B setting + // Define way to set color correction factors for R,G,B + // Test color correction + char** tokens = str_split(inputLine, ','); + int count = getTokenCount(tokens); + printf("%d tokens:\n\r", count); + for (int i=0; i< count; i++) { + printf("%s\n\r",tokens[i]); + } + // inputLine is the input string without the trailing carriage return, all lower case + if (!strcmp(tokens[0],"temp") || !strcmp(tokens[0],"temperature")) { + // get the temperature + sprintf(outputLine,"%dC",temperature_data_get()); + writeToBLE((const uint8_t*)outputLine); + } else if (!strcmp(tokens[0],"a") || !strcmp(tokens[0],"amp") || !strcmp(tokens[0],"amplitude")) { + long val; + if (str2int(&val, tokens[1], 10) == STR2INT_SUCCESS) { + if (val < 5) val = 5; + if (val > 100) val = 100; + lastAmplitude = (uint8_t) val; + rebuildGammaTables((uint8_t) ((val*0xFF)/100)); + } + + } else if (!strcmp(tokens[0],"c") || !strcmp(tokens[0],"chan") || !strcmp(tokens[0],"channel")) { + if (getTokenCount(tokens) == 5) { + //printf("Processing chan.\n\r"); + // tokens are command name, channel, r, g, b + if (str2int(&channel, tokens[1], 10) == STR2INT_SUCCESS && + str2int(&r, tokens[2], 16) == STR2INT_SUCCESS && + str2int(&g, tokens[3], 16) == STR2INT_SUCCESS && + str2int(&b, tokens[4], 16) == STR2INT_SUCCESS) { + setMode(0); + sprintf(outputLine, "%d: %x,%x,%x", (uint16_t) channel, (uint16_t) r, (uint16_t) g, (uint16_t) b); + printf ("%s\n\r", outputLine); + //wait(0.03) + writeToBLE((const uint8_t*)outputLine); + setChannelToRGB( (int) channel, (uint16_t) r, (uint16_t) g, (uint16_t) b); + theChip->latchData(); + } + } + } else if (!strcmp(tokens[0],"list")) { + printf("Processing list.\n\r"); + + // output all channel settings + for (int i=0; i< CHANNELS_PER_IC * NUMBER_OF_ICS; i++) { + sprintf(outputLine, "%d: %x, %x, %x", i, debugRedOut[i], debugGreenOut[i], debugBlueOut[i]); + writeToBLE((const uint8_t*)outputLine); + wait(0.03); + } + } else if (!strcmp(tokens[0],"time")) { + long theTime; + if (str2int(&theTime, tokens[1], 10) == STR2INT_SUCCESS) { + TheElapsedTime = ((theTime/100)-1)*60*60*1000 + ((theTime%100)*60*1000) - CLOCK_GRANULARITY; + } + } else if (!strcmp(tokens[0],"m") || !strcmp(tokens[0],"mode")) { + long mode; + if (str2int(&mode, tokens[1], 10) == STR2INT_SUCCESS) { + setMode(mode); + printf("Set mode to %d\n\r", getMode()); + writeToBLE("Set mode."); + } + } else if (!strcmp(tokens[0],"interval") || !strcmp(tokens[0],"int")) { + long movementInterval; + if (str2int(&movementInterval, tokens[1], 10) == STR2INT_SUCCESS) { + if (movementInterval < 300) movementInterval = 300; + if (movementInterval > 10000) movementInterval = 10000; + UserAdjustableMovementInterval = (uint16_t) movementInterval; + } + } else if (!strcmp(tokens[0],"base") || !strcmp(tokens[0],"b")) { + printf ("Got base.\n\r"); + if (getTokenCount(tokens) == 5) { + int dither = ditherToEnum(tokens[1]); + int effect = effectToEnum(tokens[2]); + const int* colorList = colorListToPointer(tokens[3]); + long timeConstant; + // set a fixed base until mode is reset + if (dither != -1 && + effect != -1 && + colorList != NULL && + str2int(&timeConstant, tokens[4], 10) == STR2INT_SUCCESS) { + + if (getMode() == USER_MOVEMENT || getMode() == USER_MOVEMENT_AND_BASE) { + setMode(USER_MOVEMENT_AND_BASE); + } else { + setMode(USER_BASE); + } + printf("Setting base.\n\r"); + setBaseEffect( dither, effect, colorList, (int) timeConstant*100 ); + writeToBLE("Base set."); + } else { + writeToBLE("Err: Parsing."); + } + } else { + writeToBLE("Err: Token count."); + } + } else if (!strcmp(tokens[0],"effect") || !strcmp(tokens[0],"e")) { + if (getTokenCount(tokens) == 8) { + int movement = movementToEnum(tokens[1]); + int dither = ditherToEnum(tokens[2]); + int fill = fillToEnum(tokens[3]); + int effect = effectToEnum(tokens[4]); + const int* colorList = colorListToPointer(tokens[5]); + long timeConstant; + long moveTimeConstant; + // set a fixed base until mode is reset + if (movement != -1 && + dither != -1 && + effect != -1 && + colorList != NULL & + str2int(&timeConstant, tokens[6], 10) == STR2INT_SUCCESS && + str2int(&moveTimeConstant, tokens[7], 10) == STR2INT_SUCCESS) { + + if (getMode() == USER_BASE || getMode() == USER_MOVEMENT_AND_BASE) { + setMode(USER_MOVEMENT_AND_BASE); + } else { + setMode(USER_MOVEMENT); + } + setOverlayEffect( movement, dither, fill, effect, colorList, (int) timeConstant*100, (int) moveTimeConstant*100 ); + writeToBLE("Effect set."); + } else { + writeToBLE("Err: Parsing."); + } + } else { + writeToBLE("Err: Token count."); + } + } else if (!strcmp(tokens[0],"help") || !strcmp(tokens[0],"h")) { + int hour = 1 + (TheElapsedTime / (60*60*1000)); + int minute = (TheElapsedTime % (60*60*1000))/(60*1000); + int second = (TheElapsedTime % (60*1000)) / 1000; + sprintf(outputLine, "T:%02d:%02d:%02d,M=%d,A=%d", hour, minute, second, getMode(), lastAmplitude); + writeToBLE((const uint8_t*)outputLine); + wait(0.03); + writeToBLE("BASE:dither,effect"); + wait(0.03); + writeToBLE(",color,time"); + wait(0.03); + writeToBLE("EFFECT:move,dither"); + wait(0.03); + writeToBLE(",fill,effect,color"); + wait(0.03); + writeToBLE(",time,moveTime"); + wait(0.03); + writeToBLE("MOVE:v+,v-,h+,h-,r+,"); + wait(0.03); + writeToBLE("r-,b+,b-,al,of"); + wait(0.03); + writeToBLE("DITHER:Fixed,Cross,"); + wait(0.03); + writeToBLE("In,Out,Strob, Puls"); + wait(0.03); + writeToBLE("FILL:Line,Fill"); + wait(0.03); + writeToBLE("EFFECT:Const,Ran"); + wait(0.03); + writeToBLE("Seq,Fixed"); + wait(0.03); + writeToBLE("COLOR:al,te,el,pa,"); + wait(0.03); + writeToBLE("pu,bl,gr,re,su,ye,"); + wait(0.03); + writeToBLE("da,go,sh"); + } else { + writeToBLE("Unknown command."); + } + + for (int i=0; tokens[i] != 0;i++) { + free(tokens[i]); + } + + dataToProcess = FALSE; +} + +void buttonHandlerAllRed() { + setMode(0); + for (int i=0; i< CHANNELS_PER_IC * NUMBER_OF_ICS; i++) { + setChannelToRGB( (int) i, (uint16_t) allRed ? 0xFF : 0, (uint16_t) 0, (uint16_t) 0); + } + theChip->latchData(); + printf("All red: %d\n\r",allRed); + allRed = !allRed; +} + +void buttonHandlerAllGreen() { + setMode(0); + for (int i=0; i< CHANNELS_PER_IC * NUMBER_OF_ICS; i++) { + setChannelToRGB( (int) i, (uint16_t) 0, (uint16_t) allGreen ? 0xFF : 0, (uint16_t) 0); + } + theChip->latchData(); + printf("All green: %d\n\r",allGreen); + allGreen = !allGreen; +} + +void buttonHandlerAllBlue() { + setMode(0); + for (int i=0; i< CHANNELS_PER_IC * NUMBER_OF_ICS; i++) { + setChannelToRGB( (int) i, (uint16_t) 0, (uint16_t) 0, (uint16_t) allBlue ? 0xFF : 0); + } + theChip->latchData(); + printf("All blue: %d\n\r",allBlue); + allBlue = !allBlue; +} + +void buttonHandlerMode1() { + printf("Movement enabled.\n\r"); + setMode(1); +} + int main(void) { - led1 = 1; + unsigned short dotCorrect[48]; Ticker ticker; - ticker.attach(periodicCallback, 1); + + button1.rise(&buttonHandlerAllRed); + button2.rise(&buttonHandlerAllGreen); + button3.rise(&buttonHandlerAllBlue); + button4.rise(&buttonHandlerMode1); + + // Set dot correct to maximum brightness for all channels + for (int i=0;i<48;i++) { + dotCorrect[i] = 0x7F; + } + + // SCLK = P0_1, MOSI = P0_2, GSCLK = P0_3, LAT = P0_4 + theChip = new TLC5955(P0_1, P0_2, P0_3, P0_4); + + + + wait(0.01); + + // Initial settings + + theChip->setNewControlData(0x7F, 0x7F, 0x7F, // global brightness set to max for R, G, and B channels + TLC5955::I_3_2_MA, TLC5955::I_3_2_MA, TLC5955::I_3_2_MA, // maximum current set to 3.2mA for R, G, and B channels + dotCorrect); + + wait(0.01); + + theChip->latchData(); // set all channels to zero, which is the default + + DEBUG("\n\r\n\rTLC5955 Reset.\n\r"); + + SequencerConfig(); + + ticker.attach(periodicCallback, SEQUENCER_RATE); + + // In case setup takes some amount of time, we're doing it after we turn off the LEDs. + ble = new BLEDevice(); DEBUG("Initialising the nRF51822\n\r"); - ble.init(); - ble.onDisconnection(disconnectionCallback); - ble.onDataWritten(onDataWritten); + ble->init(); + ble->onDisconnection(disconnectionCallback); + ble->onConnection(connectCallback); + ble->onDataWritten(onDataWritten); /* setup advertising */ - ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED); - ble.setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED); - ble.accumulateAdvertisingPayload(GapAdvertisingData::SHORTENED_LOCAL_NAME, - (const uint8_t *)"BLE UART", sizeof("BLE UART") - 1); - ble.accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_128BIT_SERVICE_IDS, + ble->accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED); + ble->setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED); + ble->accumulateAdvertisingPayload(GapAdvertisingData::SHORTENED_LOCAL_NAME, + (const uint8_t *)"DuckLights", sizeof("DuckLights") - 1); + ble->accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_128BIT_SERVICE_IDS, (const uint8_t *)UARTServiceUUID_reversed, sizeof(UARTServiceUUID_reversed)); - ble.setAdvertisingInterval(1000); /* 1000ms; in multiples of 0.625ms. */ - ble.startAdvertising(); + ble->setAdvertisingInterval(1000); /* 1000ms; in multiples of 0.625ms. */ + ble->startAdvertising(); - UARTService uartService(ble); + UARTService uartService(*ble); uartServicePtr = &uartService; + DEBUG("Entering infinite loop.\n\r"); + while (true) { - ble.waitForEvent(); + ble->waitForEvent(); + if (dataToProcess) { + parseInputData(); + } } }
diff -r 15764cc1f12c -r 73923b07ae4a mbed.bld --- a/mbed.bld Tue Sep 29 12:02:15 2015 +0000 +++ b/mbed.bld Sat Jun 09 23:23:06 2018 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/4f6c30876dfa \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/bad568076d81 \ No newline at end of file
diff -r 15764cc1f12c -r 73923b07ae4a sequencer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sequencer.cpp Sat Jun 09 23:23:06 2018 +0000 @@ -0,0 +1,913 @@ +/* + +Control lighting sequences + + +*/ + +#include "TLC5955.h" +#include <ctype.h> +#include "sequencer.h" +#include "color.h" + +DigitalOut led1(LED1); + +// zero-based time, starts at 7:30PM +volatile uint32_t TheElapsedTime = (1000*60*60*6) + (1000*60*30); + + +// THE FOLLOWING CHANNELS (ZERO-BASED) ARE BROKEN, AND ARE SKIPPED: +// 4,6,14, 35-46 + + +// Each row address indivual panels starting at the front right panel and moving clockwise as viewed from below +// These are the two middle (internal-use) channels: 12, 34 + +int PANELS[ROWS][COLUMNS] = { + {0, 1, 2, 3, 5, 7} , // Lowest row of panels + {8, 9, 10, 11, 13, 15} , + {16, 17, 18, 19, 20, 21} , + {22, 23, 24, 25, 26, 27} , + {28, 29, 31, 32, 33, 34} // Highest row of panels + }; + +//int PANELS[5][6] = { +// {0, 1, 2, 3, 4, 5} , // Lowest row of panels +// {6, 7, 8, 9, 10, 11} , +// {12, 13, 14, 15, 16, 17} , +// {18, 19, 20, 21, 22, 23} , +// {24, 25, 26, 27, 28, 29} // Highest row of panels +//}; + +int CHANNEL_MAPPING[] = { 8, 12, 9, 13, 14, 10, 15, 11, 7, 3, 6, 2, 1, 5, 0, 4 }; + +uint16_t debugRedOut[NUMBER_OF_PANELS]; +uint16_t debugGreenOut[NUMBER_OF_PANELS]; +uint16_t debugBlueOut[NUMBER_OF_PANELS]; + +volatile int channelColorSettings[NUMBER_OF_PANELS]; +volatile int Settings[NUMBER_OF_PANELS]; +volatile int channelColorPointer[2][NUMBER_OF_PANELS]; +volatile int randomBaseTimeOffset[NUMBER_OF_PANELS]; +volatile int randomMovementTimeOffset[NUMBER_OF_PANELS]; + +volatile uint16_t UserAdjustableMovementInterval = 2000; + +extern TLC5955* theChip; + +volatile int TheBaseDitherMode; +volatile int TheBaseEffectType; +volatile int TheBaseTimeConstant; +volatile uint32_t TheBaseEffectStartTime; +const int* TheBaseColorList; + +volatile int TheMovementPosition; +volatile int TheMoveEndPosition; +volatile int TheMovementNumberOfLevels; +volatile int NumberOfMovesSoFar; + +void (*TheMovementAddressModePtr)(int,const int*,int); + +volatile int TheMovementMode; +volatile int TheDitherMode; +volatile int TheMovementFill; +volatile int TheEffectType; +const int* TheColorList; +volatile int TheTimeConstant; +volatile int TheMoveTimeConstant; +volatile uint32_t TheEffectStartTime; +volatile int TheMode=1; // lighting effect mode. zero is off. +volatile bool inMinuteEffect = FALSE; +volatile bool inHourEffect = FALSE; + +// https://developer.mbed.org/questions/2886/Why-is-the-rand-function-not-the-least-b/ +unsigned int m_z=12434,m_w=33254; +unsigned int rnd() { + m_z = 36969 * (m_z & 65535) + (m_z >>16); + m_w = 18000 * (m_w & 65535) + (m_w >>16); + return ((m_z <<16) + m_w); +} + +void setMode(int mode) { + TheMode = mode; +} + +int getMode() { + return TheMode; +} + + +int movementToEnum(char* input) { + if (!strcmp(input,"v-")) { + return VERTICAL_UP; + } else if (!strcmp(input,"v+")) { + return VERTICAL_DOWN; + } else if (!strcmp(input,"h+")) { + return HORIZONTAL_FORWARD; + } else if (!strcmp(input,"h-")) { + return HORIZONTAL_BACKWARDS; + } else if (!strcmp(input,"r+")) { + return RADIAL_CLOCKWISE; + } else if (!strcmp(input,"r-")) { + return RADIAL_COUNTERCLOCKWISE; + } else if (!strcmp(input,"b+")) { + return BARREL_CLOCKWISE; + } else if (!strcmp(input,"b-")) { + return BARREL_COUNTERCLOCKWISE; + } else if (!strcmp(input,"al")) { + return ALL; + } else if (!strcmp(input,"of")) { + return OFF; + } else { + return -1; + } +} + +int ditherToEnum(char* input) { + if (!strcmp(input,"f")) { + return FIXED; + } else if (!strcmp(input,"c")) { + return CROSSFADE; + } else if (!strcmp(input,"i")) { + return FADE_IN; + } else if (!strcmp(input,"o")) { + return FADE_OUT_AND_IN; + } else if (!strcmp(input,"s")) { + return FADE_IN_AND_OUT; + } else if (!strcmp(input,"p")) { + return PULSED_INTENSITY; + } else { + return -1; + } +} + +int fillToEnum(char* input) { + if (!strcmp(input,"l")) { + return LINE; + } else if (!strcmp(input,"f")) { + return FILL; + } else { + return -1; + } +} + +int effectToEnum(char* input) { + if (!strcmp(input,"c")) { + return CONSTANT; + } else if (!strcmp(input,"r")) { + return RANDOM; + } else if (!strcmp(input,"s")) { + return SEQUENCE; + } else if (!strcmp(input,"f")) { + return FIXED_RANDOM; + } else { + return -1; + } +} + +// only compare first two characters. The rest are unused. +const int* colorListToPointer(char* input) { + char shortInput[3] ; + shortInput[0] = input[0]; + shortInput[1] = input[1]; + shortInput[2] = 0; + for (int i=0; i< USER_COLOR_CHOICES_SIZE; i++) { + char shortColor[3]; + shortColor[0] = listOfColorLists[i].colorListName[0]; + shortColor[1] = listOfColorLists[i].colorListName[1]; + shortColor[2] = 0; + if (!strcmp (shortColor, shortInput)) { + return listOfColorLists[i].colorList; + } + } + return NULL; +} + +// The channels on the board are numbered differently than the channels in software, so this corrects for it +int channelMapping(int channel) { + int valueToMap = channel % 16; + int channelOffset = channel / 16; + return (channelOffset*16) + CHANNEL_MAPPING[valueToMap]; +} + +int getColorArraySize(const int* colorArray) { + int i=0; + while (colorArray[i] != -1) { + i++; + } + return i; +} + +int pickRandomColorFromArray(const int* colorArray) { + int n = getColorArraySize(colorArray); + int random = colorArray[rnd() % n]; + //printf("n=%d, s=%d, r=%d\n\r",n, rnd(), random); + return random; +} + +void setArrayColor(int panel, int color, bool isBaseEffect) { + channelColorPointer[isBaseEffect][panel] = color; +} + +int getArrayColor(int panel, bool isBaseEffect) { + return channelColorPointer[isBaseEffect][panel]; +} + +int pickNextColorFromArray(int panel, const int* colorArray, bool isBaseEffect) { + channelColorPointer[isBaseEffect][panel]++; + int n = getColorArraySize(colorArray); + channelColorPointer[isBaseEffect][panel] = channelColorPointer[isBaseEffect][panel] % n; + return colorArray[channelColorPointer[isBaseEffect][panel]]; +} + +void setChannelToColorName(int channel, int colorName) { + debugRedOut[channel] = color_data[colorName].rgb.r; + debugGreenOut[channel] = color_data[colorName].rgb.g; + debugBlueOut[channel] = color_data[colorName].rgb.b; + + channel = channelMapping(channel); + theChip->setChannel(channel, + color_data[colorName].rgb.r, + color_data[colorName].rgb.g, + color_data[colorName].rgb.b); +} + +// 8 bit r,g,b for 24 bit color +void setChannelToRGB(int channel, uint16_t r, uint16_t g, uint16_t b) { + + debugRedOut[channel] = r; + debugGreenOut[channel] = g; + debugBlueOut[channel] = b; + + channel = channelMapping(channel); + theChip->setChannel(channel,r,g,b); +} + +void setStartingMovePosition() { + switch(TheMovementMode) { + case VERTICAL_UP: + TheMovementPosition=-1; + TheMoveEndPosition=4; + break; + case VERTICAL_DOWN: + TheMovementPosition=5; + TheMoveEndPosition=0; + break; + case HORIZONTAL_FORWARD: + TheMovementPosition=-1; + TheMoveEndPosition=2; + break; + case HORIZONTAL_BACKWARDS: + TheMovementPosition=3; + TheMoveEndPosition=0; + break; + case RADIAL_CLOCKWISE: + TheMovementPosition=-1; + TheMoveEndPosition=5; + + break; + case RADIAL_COUNTERCLOCKWISE: + TheMovementPosition=6; + TheMoveEndPosition=0; + break; + case BARREL_CLOCKWISE: + TheMovementPosition=-1; + TheMoveEndPosition=9; + break; + case BARREL_COUNTERCLOCKWISE: + TheMovementPosition=10; + TheMoveEndPosition=0; + break; + case ALL: + case OFF: + TheMovementPosition=-1; + TheMoveEndPosition=2; + default: + break; + } +} + +void setPanelTargetColor(int channel, int aColor) { + channelColorSettings[channel] = aColor; +} + +int getPanelTargetColor(int channel) { + return channelColorSettings[channel]; +} + +void setPanelStartingColor(int channel, int aColor) { + Settings[channel] = aColor; +} + +int getPanelStartingColor(int channel) { + return Settings[channel]; +} + + +const char* getNameFromColorNumber(int color) { + return color_data[color].name; +} + + +void setBaseEffect( int ditherMode, int effectType, const int* colorList, int timeConstant ) { + TheBaseDitherMode = ditherMode; + TheBaseEffectType = effectType; + TheBaseColorList = colorList; + TheBaseTimeConstant = timeConstant; // controls internal fades, blinking, etc. + TheBaseEffectStartTime = TheElapsedTime; + + //printf ("New Base Effect. t=%d:%d dither=%d, effect=%d, firstColor=%s, timeConstant=%d\n\r", + //(TheElapsedTime/(1000*60*60))+1, (TheElapsedTime%(1000*60*60))/(60*1000), + //ditherMode, effectType, getNameFromColorNumber(colorList[0]), timeConstant); + + if (TheBaseEffectType == CONSTANT) { + // set all panels to a randomly selected color + int theColor = pickRandomColorFromArray(colorList); + //printf ("Using constant base color=(%d), %s\n\r", theColor, getNameFromColorNumber(theColor)); + for (int i=0; i< NUMBER_OF_PANELS; i++) { + setPanelStartingColor(i, getPanelTargetColor(i)); + setArrayColor(i, theColor,1); + } + } else if (TheBaseEffectType == FIXED_RANDOM) { + // set each panel to a randomly selected color that doesn't change for the duration of the effect + for (int i=0; i< NUMBER_OF_PANELS; i++) { + setPanelStartingColor(i, getPanelTargetColor(i)); + setArrayColor(i, pickRandomColorFromArray(colorList),1); + } + } + + for (int i=0; i< NUMBER_OF_PANELS; i++) { + randomBaseTimeOffset[i] = rnd() % TheBaseTimeConstant/2; + } +} + + +void setOverlayEffect( int movementMode, int ditherMode, int movementFill, int effectType, const int* colorList, int timeConstant, int moveTimeConstant ) { + TheMovementMode = movementMode; + TheDitherMode = ditherMode; + TheMovementFill = movementFill; + TheEffectType = effectType; + TheColorList = colorList; + TheTimeConstant = timeConstant; // controls internal fades, blinking, etc. + TheMoveTimeConstant = moveTimeConstant; + TheEffectStartTime = TheElapsedTime; + NumberOfMovesSoFar = 0; + setStartingMovePosition(); + //printf ("New Movement Effect. move=%d, dither=%d, effect=%d, firstColor=%s, timeConstant=%d\n\r", + //movementMode, ditherMode, effectType, getNameFromColorNumber(colorList[0]), timeConstant); + + if (TheEffectType == CONSTANT) { + // set all panels to a randomly selected color + int theColor = pickRandomColorFromArray(colorList); + //printf ("Using constant overlay color=(%d), %s\n\r", theColor, getNameFromColorNumber(theColor)); + for (int i=0; i< NUMBER_OF_PANELS; i++) { + setPanelStartingColor(i, getPanelTargetColor(i)); + setArrayColor(i, theColor,0); + } + } else if (TheEffectType == FIXED_RANDOM) { + // set each panel to a randomly selected color that doesn't change for the duration of the effect + for (int i=0; i< NUMBER_OF_PANELS; i++) { + setPanelStartingColor(i, getPanelTargetColor(i)); + setArrayColor(i, pickRandomColorFromArray(colorList),0); + } + } + for (int i=0; i< NUMBER_OF_PANELS; i++) { + randomMovementTimeOffset[i] = rnd() % TheTimeConstant/2; + } +} + +inline void crossFade(int startingR, int startingG, int startingB, int endingR, int endingG, int endingB, uint32_t timeConstant, uint32_t currentTime, uint16_t* r, uint16_t* g, uint16_t* b) { + currentTime = currentTime % timeConstant; + + //printf("crossFrade current=%d, total=%d\n\r", currentTime, timeConstant); + + //if (currentTime > timeConstant) currentTime = timeConstant; + + *r = (uint16_t) ((((uint32_t)startingR * (uint32_t)(timeConstant - currentTime)) + ( (uint32_t)endingR * (uint32_t) currentTime)) / ((uint32_t) timeConstant)); + *g = (uint16_t) ((((uint32_t)startingG * (uint32_t)(timeConstant - currentTime)) + ( (uint32_t)endingG * (uint32_t) currentTime)) / ((uint32_t) timeConstant)); + *b = (uint16_t) ((((uint32_t)startingB * (uint32_t)(timeConstant - currentTime)) + ( (uint32_t)endingB * (uint32_t) currentTime)) / ((uint32_t) timeConstant)); + + //printf ("t=%d, c=%d, start=(%x,%x,%x), ending=(%x,%x,%x), now=%x,%x,%x\n\r", currentTime, timeConstant, startingR, startingG, startingB, endingR, endingG, endingB, *r, *b, *g ); + //printf("s={%d,%d,%d}, e={%d,%d,%d}, c={%d,%d,%d}\n\r", startingR, startingG, startingB, endingR, endingG, endingB, *r, *g, *b); +} + +inline void crossFade(int startingColor, int endingColor, uint32_t timeConstant, uint32_t currentTime, uint16_t* r, uint16_t* g, uint16_t* b) { + int startingR, startingG, startingB; + int endingR, endingG, endingB; + + startingR = color_data[startingColor].rgb.r; + startingG = color_data[startingColor].rgb.g; + startingB = color_data[startingColor].rgb.b; + + endingR = color_data[endingColor].rgb.r; + endingG = color_data[endingColor].rgb.g; + endingB = color_data[endingColor].rgb.b; + + crossFade(startingR, startingG, startingB, endingR, endingG, endingB, timeConstant, currentTime, r, g, b); +} + +void manageDither(int totalTimeForEffect, int timeIntoEffect, int startingColor, int endingColor, int panel) { + uint16_t r,g,b; + + switch (TheBaseDitherMode) { + case FIXED: + setChannelToColorName(panel, endingColor); + break; + case CROSSFADE: + crossFade(startingColor, endingColor, totalTimeForEffect, timeIntoEffect, &r, &g, &b); + setChannelToRGB(panel,r,g,b); + break; + case FADE_IN: + crossFade(COLOR_BLACK, endingColor, totalTimeForEffect, timeIntoEffect, &r, &g, &b); + setChannelToRGB(panel,r,g,b); + break; + case FADE_OUT_AND_IN: + if (timeIntoEffect < totalTimeForEffect/2) { + crossFade(startingColor, COLOR_BLACK, totalTimeForEffect/2, timeIntoEffect, &r, &g, &b); + } else { + crossFade(COLOR_BLACK, endingColor, totalTimeForEffect/2, timeIntoEffect - (totalTimeForEffect/2), &r, &g, &b); + } + setChannelToRGB(panel,r,g,b); + break; + case FADE_IN_AND_OUT: + if (timeIntoEffect < totalTimeForEffect/2) { + crossFade(COLOR_BLACK, endingColor, totalTimeForEffect/2, timeIntoEffect, &r, &g, &b); + } else { + crossFade(endingColor, COLOR_BLACK, totalTimeForEffect/2, timeIntoEffect - (totalTimeForEffect/2), &r, &g, &b); + } + setChannelToRGB(panel,r,g,b); + break; + case PULSED_INTENSITY: + if (timeIntoEffect < totalTimeForEffect/2) { + crossFade( color_data[endingColor].rgb.r/4, color_data[endingColor].rgb.g/4, color_data[endingColor].rgb.b/4, + color_data[endingColor].rgb.r, color_data[endingColor].rgb.g, color_data[endingColor].rgb.b, + totalTimeForEffect/2, timeIntoEffect, &r, &g, &b); + } else { + crossFade( color_data[endingColor].rgb.r, color_data[endingColor].rgb.g, color_data[endingColor].rgb.b, + color_data[endingColor].rgb.r/4, color_data[endingColor].rgb.g/4, color_data[endingColor].rgb.b/4, + totalTimeForEffect/2, timeIntoEffect, &r, &g, &b); + } + setChannelToRGB(panel,r,g,b); + break; + default: + break; + } +} + + +int isTimeForNewColor(int timeConstant, int timeSoFar) { + if (timeSoFar % timeConstant < CLOCK_GRANULARITY) { + //printf("isTime! soFar=%d, c=%d\n\r", timeSoFar, timeConstant); + return true; + } else { + return false; + } +} + + +void manageEffectType(int panel, const int* colorList, int isBaseEffect) { + uint32_t startTime, timeConstant; + int effectType; + + if (isBaseEffect) { + effectType = TheBaseEffectType; + timeConstant = TheBaseTimeConstant - (effectType == RANDOM) ? randomBaseTimeOffset[panel] : 0; + startTime = TheBaseEffectStartTime; + } else { + effectType = TheEffectType; + timeConstant = TheTimeConstant - (effectType == RANDOM) ? randomMovementTimeOffset[panel] : 0; + startTime = TheEffectStartTime; + } + + + + switch (effectType) { + case CONSTANT: + case FIXED_RANDOM: + // the colors are selected when the effect is first created + setPanelStartingColor(panel, getArrayColor(panel, isBaseEffect)); + setPanelTargetColor(panel, getArrayColor(panel, isBaseEffect)); + break; + case RANDOM: + // TODO: Change to a random number that is picked so that the average length will be elapsed time. (probability at elapsedTime is 50% that it will be time) + if (isTimeForNewColor(timeConstant, TheElapsedTime-startTime)) { + setPanelStartingColor(panel, getPanelTargetColor(panel)); + setPanelTargetColor(panel, pickRandomColorFromArray(colorList)); + if (isBaseEffect) { + randomBaseTimeOffset[panel] = rnd() % TheBaseTimeConstant / 2; + } else { + randomMovementTimeOffset[panel] = rnd() % TheTimeConstant / 2; + } + } + break; + case SEQUENCE: + if (isTimeForNewColor(timeConstant, TheElapsedTime-startTime)) { + setPanelStartingColor(panel, getPanelTargetColor(panel)); + int nextColor = pickNextColorFromArray(panel,colorList,isBaseEffect); + setPanelTargetColor(panel, nextColor); + } + // Dither from old sequence color to new sequence color + break; + case RANDOM_STROBE: + // fluctuate intensity randomly + break; + default: + break; + } + manageDither(timeConstant, TheElapsedTime-startTime, getPanelStartingColor(panel), getPanelTargetColor(panel), panel); +} + +// top-to-bottom - 5 levels +void addressVertically (int location, const int* colorList, int isBaseEffect) { + if (location >= 0 && location < 5) { + for (int i = 0; i < 6; i++) { + manageEffectType(PANELS[location][i], colorList, isBaseEffect); + } + } +} + +// front-to-back - 3 levels +void addressHorizontally (int location, const int* colorList, int isBaseEffect) { + if (location >= 0 && location < 3) { + for (int i = 0; i < 5; i++) { + manageEffectType(PANELS[i][location], colorList, isBaseEffect); + manageEffectType(PANELS[i][5-location], colorList, isBaseEffect); + } + } +} + +void addressHorizontalRadially (int location, const int* colorList, int isBaseEffect) { + if (location >= 0 && location < 6) { + for (int i = 0; i < 5; i++) { + manageEffectType(PANELS[i][location], colorList, isBaseEffect); + } + } +} + +void addressVerticallyRadially(int location, const int* colorList, int isBaseEffect) { + if (location >= 0 && location < 5) { + for (int i = 0; i < 3; i++) { + manageEffectType(PANELS[location][i], colorList, isBaseEffect); + } + } + if (location >= 5 && location < 10) { + for (int i = 3; i < 6; i++) { + manageEffectType(PANELS[9-location][i], colorList, isBaseEffect); + } + } +} + +int getMovementLevels(int aMovementMode) { + switch (aMovementMode) { + case VERTICAL_UP: + return ROWS; + case VERTICAL_DOWN: + return ROWS; + case HORIZONTAL_FORWARD: + return 3; + case HORIZONTAL_BACKWARDS: + return 3; + case RADIAL_CLOCKWISE: + return 6; + case RADIAL_COUNTERCLOCKWISE: + return 6; + case BARREL_CLOCKWISE: + return 10; + case BARREL_COUNTERCLOCKWISE: + return 10; + case ALL: + return 1; + case OFF: + return 1; + default: + return 1; + } +} + +void manageMovement() { + // Track which panels get painted with the Base information, and which get the effect information + + // cycle through moves at TheMoveTimeConstant rate + //printf (">> t=%d, c=%d, %d <? %d\n\r", (TheElapsedTime-TheEffectStartTime), TheMoveTimeConstant, (TheElapsedTime-TheEffectStartTime) % TheMoveTimeConstant, CLOCK_GRANULARITY); + + if ((TheElapsedTime-TheEffectStartTime) % TheMoveTimeConstant < CLOCK_GRANULARITY) { + //printf ("Moving. Mode=%d\n\r", TheMovementMode); + switch(TheMovementMode) { + case VERTICAL_UP: + TheMovementPosition++; + TheMovementNumberOfLevels = ROWS; + TheMovementAddressModePtr = &addressVertically; + break; + case VERTICAL_DOWN: + TheMovementPosition--; + TheMovementNumberOfLevels = ROWS; + TheMovementAddressModePtr = &addressVertically; + break; + case HORIZONTAL_FORWARD: + TheMovementPosition++; + TheMovementNumberOfLevels = 3; + TheMovementAddressModePtr = &addressHorizontally; + break; + case HORIZONTAL_BACKWARDS: + TheMovementPosition--; + TheMovementNumberOfLevels = 3; + TheMovementAddressModePtr = &addressHorizontally; + break; + case RADIAL_CLOCKWISE: + TheMovementNumberOfLevels = 6; + TheMovementPosition++; + TheMovementAddressModePtr = &addressHorizontalRadially; + break; + case RADIAL_COUNTERCLOCKWISE: + TheMovementNumberOfLevels = 6; + TheMovementPosition--; + TheMovementAddressModePtr = &addressHorizontalRadially; + break; + case BARREL_CLOCKWISE: + TheMovementPosition++; + TheMovementNumberOfLevels = 10; + TheMovementAddressModePtr = &addressVerticallyRadially; + break; + case BARREL_COUNTERCLOCKWISE: + TheMovementPosition--; + TheMovementNumberOfLevels = 10; + TheMovementAddressModePtr = &addressVerticallyRadially; + break; + case ALL: + TheMovementPosition = 0; + TheMovementNumberOfLevels = 3; + TheMovementAddressModePtr = &addressHorizontally; + break; + case OFF: + TheMovementPosition = 0; + TheMovementNumberOfLevels = 3; + TheMovementAddressModePtr = &addressHorizontally; + break; + default: + break; + } + if (TheMovementMode != OFF) { + NumberOfMovesSoFar++; + //printf ("Incrementing moves to: %d\n\r", NumberOfMovesSoFar); + } + } + // end the move after it has reached its end + if (NumberOfMovesSoFar > TheMovementNumberOfLevels) { + //printf ("TURNING MOVE OFF.\n\r"); + TheMovementMode = OFF; + NumberOfMovesSoFar = 0; + } + + if (TheMovementPosition < 0) TheMovementPosition = TheMovementNumberOfLevels-1; + TheMovementPosition = TheMovementPosition % TheMovementNumberOfLevels; + + + //printf("mode=%d, pos=%d, levels=%d, numMoves=%d\n\r",TheMovementMode, TheMovementPosition, TheMovementNumberOfLevels, NumberOfMovesSoFar); + + // paint all the subeffects at 40Hz (or whatever the refresh rate is) + for (int i=0; i < TheMovementNumberOfLevels; i++) { + if (TheMovementMode != OFF && (i < TheMovementPosition && TheMovementFill == FILL || (TheMovementMode == ALL))) { + TheMovementAddressModePtr (i, TheColorList, false); + } else if (i == TheMovementPosition && (TheMovementMode != OFF)){ + TheMovementAddressModePtr (i, TheColorList, false); + } else { + TheMovementAddressModePtr (i, TheBaseColorList, true); + } + } + + // Latch the current color settings into the hardware + theChip->latchData(); +} + +const int* getRandomMovementColorList() { + return movementColors[rnd() % MOVEMENT_COLOR_LIST_SIZE]; +} + +const int* getRandomBaseColorList() { + return baseColors[rnd() % BASE_COLOR_LIST_SIZE]; +} + +const int* getRandomColorList() { + return listOfColorLists[rnd() % USER_COLOR_CHOICES_SIZE].colorList; +} + +void generateBaseEffect(bool isBackgroundYellow) { + if (TheMode == USER_BASE || TheMode == USER_MOVEMENT_AND_BASE) { + return; // already set by user + } else { + int randomDitherMode = rnd() % 6; + int randomEffectType = rnd() % 4; + const int* randomColorList; + if (isBackgroundYellow) { + randomColorList = getRandomBaseColorList(); + } else { + randomColorList = getRandomMovementColorList(); + } + int timeConstant = 300 + (rnd() % 8000); + setBaseEffect( randomDitherMode, randomEffectType, randomColorList, timeConstant ); + } +} + +void generateMovementEffect(int durationMS) { + + // select a random movement effect to overlay onto the base effect + if (TheMode == USER_MOVEMENT || TheMode == USER_MOVEMENT_AND_BASE) { + return; // already set by user + } else { + int randomMovementMode = rnd() % 9; + int randomDitherMode = rnd() % 6; + int randomMovementFill = rnd() % 3; + int randomEffectType = rnd() % 4; + const int* randomColorList = getRandomMovementColorList(); + int moveTimeConstant = (durationMS*(3+(rnd()%5))/8) / getMovementLevels(randomMovementMode); + //int timeConstant = ((durationMS*7)/8) / getMovementLevels(randomMovementMode); + int timeConstant = 200 + (rnd() % (durationMS-200)); + setOverlayEffect( randomMovementMode, randomDitherMode, randomMovementFill, randomEffectType, randomColorList, timeConstant, moveTimeConstant); + //printf ("New Movement Effect. move=%d, dither=%d, effect=%d, firstColor=%s, timeConstant=%d\n\r", + } +} + +// hour is zero based, starting at midnight +void generateHourlyMovement(int hour, int msIntoEffect) { + inHourEffect = TRUE; + + if (msIntoEffect < 2000) { + // turn off for two seconds + setChannelToColorName (BEAK, COLOR_BLACK); + setChannelToColorName (EYES, COLOR_BLACK); + setBaseEffect( CROSSFADE, CONSTANT, Black, 500 ); + setOverlayEffect( ALL, FIXED, LINE, CONSTANT, Black, 2000, 2000); + } else if (msIntoEffect < 3000 + (hour*1000)) { + if (msIntoEffect%1000 < 500) { + //normal + setChannelToColorName (BEAK, COLOR_ORANGE_WEB_COLOR); + setChannelToColorName (EYES, COLOR_RED); + setBaseEffect( FIXED, CONSTANT, OneYellow, 500 ); + setOverlayEffect( OFF, FIXED, LINE, CONSTANT, Black, 500, 500); + } else { + //weird + setChannelToColorName (BEAK, COLOR_HUNTER_GREEN); + setChannelToColorName (EYES, COLOR_BLUE); + setBaseEffect( FIXED, RANDOM, Electrics, 100 ); + setOverlayEffect( OFF, FIXED, LINE, CONSTANT, Black, 500, 500); + } + + } else if (msIntoEffect < 4000 + (hour*1000)) { + // turn off for one seconds + setChannelToColorName (BEAK, COLOR_BLACK); + setChannelToColorName (EYES, COLOR_BLACK); + setChannelToColorName(INTERNAL1, COLOR_RED); + setChannelToColorName(INTERNAL2, COLOR_RED); + setBaseEffect( CROSSFADE, CONSTANT, Black, 500 ); + setOverlayEffect( ALL, FIXED, LINE, CONSTANT, Black, 2000, 2000); + } else { + inHourEffect = FALSE; + // select a new yellow (normal duck) base effect + generateBaseEffect(true); + setChannelToColorName (BEAK, COLOR_ORANGE_WEB_COLOR); + setChannelToColorName (EYES, COLOR_BLUE); + setChannelToColorName(INTERNAL1, COLOR_WHITE); + setChannelToColorName(INTERNAL2, COLOR_WHITE); + } +} + +void generatePerMinuteMovement(int msIntoEffect) { + inMinuteEffect = TRUE; + + // end after 4 seconds + if (msIntoEffect >= 4000) { + inMinuteEffect = FALSE; + // select a new yellow (normal duck) base effect + generateBaseEffect(true); + setChannelToColorName (BEAK, COLOR_ORANGE_WEB_COLOR); + setChannelToColorName (EYES, COLOR_BLUE); + setChannelToColorName(INTERNAL1, COLOR_WHITE); + setChannelToColorName(INTERNAL2, COLOR_WHITE); + } else { + if (msIntoEffect % 500 < CLOCK_GRANULARITY) { + // do some number of movement effects in a row, twice a second + generateBaseEffect(false); + generateMovementEffect(500); + setChannelToColorName (BEAK, COLOR_HUNTER_GREEN); + setChannelToColorName (EYES, COLOR_RED); + setChannelToColorName(INTERNAL1, COLOR_RED); + setChannelToColorName(INTERNAL2, COLOR_RED); + } + } +} + + +// This could also be used to beat match, hence the duration +void generatePerSecondMovement(int durationMS) { + // single movement effect + // if the movement effect is a fill, it will be restored in the next cycle + generateMovementEffect(durationMS); +} + + +void manageTimedInteractions() { + TheElapsedTime += CLOCK_GRANULARITY; // called every 25mS + if (TheElapsedTime % 43200000 < CLOCK_GRANULARITY) { + TheElapsedTime = 0; // reset timer at midnight + } else if (TheElapsedTime % 3600000 < CLOCK_GRANULARITY || inHourEffect) { + // hourly tasks (reset timer) + generateHourlyMovement(TheElapsedTime / 3600000, TheElapsedTime % 3600000); + } else if (TheElapsedTime % 60000 < CLOCK_GRANULARITY || inMinuteEffect) { + // one minute tasks + generatePerMinuteMovement(TheElapsedTime % 60000); + } else if (TheElapsedTime % UserAdjustableMovementInterval < CLOCK_GRANULARITY) { + // one second tasks + generatePerSecondMovement(UserAdjustableMovementInterval); + } + + // This manages all the effects + manageMovement(); +} + +// called prior to effects to initialize everything +void SequencerConfig() { + for (int i=0;i<NUMBER_OF_PANELS;i++) { + channelColorPointer[0][i]=0; // default to first color in list + channelColorPointer[1][i]=0; // default to first color in list + channelColorSettings[i] = COLOR_BLACK; + Settings[i] = COLOR_BLACK; + } + + TheMovementPosition = 0; + TheMovementNumberOfLevels = 3; + TheMovementAddressModePtr = &addressHorizontally; + + // Set a default base effect + //setBaseEffect( CROSSFADE, RANDOM, Electrics, 300 ); + //setBaseEffect( CROSSFADE, RANDOM, KulorSunsetCamping, 500 ); + //setBaseEffect( CROSSFADE, RANDOM, TestColors, 2000 ); + setBaseEffect( FIXED, CONSTANT, GoodYellows, 5000 ); + + // Set overlay effect to a reasonable neutral setting (OFF) + setOverlayEffect(OFF , FIXED , LINE, CONSTANT, All, 1000, 1000 ); + setChannelToColorName (BEAK, COLOR_ORANGE_WEB_COLOR); + setChannelToColorName (EYES, COLOR_BLUE); + setChannelToColorName(INTERNAL1, COLOR_WHITE); + setChannelToColorName(INTERNAL2, COLOR_WHITE); + +} + +void convertStringToLowercase(const char* input, char*output) { + for (int i=0; i<strlen(input);i++) { + output[i] = tolower(input[i]); + } + output[strlen(input)] = 0; +} + +int getColorByName(char* colorName) { + char lowerCaseInput[64]; + char lowerCaseSearch[64]; + + convertStringToLowercase(colorName, lowerCaseInput); + for (int i=0; i< COLOR_NAMES_MAX; i++) { + convertStringToLowercase(color_data[i].name, lowerCaseSearch); + if (!strcmp(lowerCaseSearch, lowerCaseInput)) { + return i; + } + } + return -1; +} + +void debugInteractions() { + // Display panel settings using a text output + printf ("t=%d\n\r", TheElapsedTime); + for (int i=0;i<ROWS;i++) { + for (int j=0;j<COLUMNS;j++) { + //printf ("-%d", (channelColorSettings[PANELS[i][j]])); + //printf ("-%u:%u:%u", debugRedOut[PANELS[i][j]], debugGreenOut[PANELS[i][j]], debugBlueOut[PANELS[i][j]]); + printf ("-%s", getNameFromColorNumber(channelColorSettings[PANELS[i][j]])); + } + printf ("\n\r"); + } + printf("\n\r\n\r"); +} + +// called at 40Hz from main's Ticker +uint16_t timeCount=0; +uint16_t count=0; +void Sequencer() { + led1 = !led1; + + if (TheMode == TEST) { + return; // mode zero turns the sequencer off. Useful for testing or setting up a static display + } else if (TheMode == SUN) { + // sun mode + for (int i=0; i< NUMBER_OF_PANELS;i++) { + setChannelToColorName(i, COLOR_WHITE); + } + theChip->latchData(); + return; + } + + // mode 1 is the standard mode + manageTimedInteractions(); + if (SEQUENCER_RATE >= 0.25) { + // only show debug output if the sequencer is running slow enough + debugInteractions(); + } +} \ No newline at end of file
diff -r 15764cc1f12c -r 73923b07ae4a sequencer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sequencer.h Sat Jun 09 23:23:06 2018 +0000 @@ -0,0 +1,72 @@ +#ifndef SEQUENCER_H +#define SEQUENCER_H + +#define NUMBER_OF_PANELS (CHANNELS_PER_IC*NUMBER_OF_ICS) +#define CLOCK_GRANULARITY 25 + +#define EYES 14 +#define BEAK 47 +#define INTERNAL1 12 +#define INTERNAL2 46 + +#define ROWS 5 +#define COLUMNS 6 + +typedef enum UserModes { + TEST=0, + DEFAULT, + SUN, + USER_MOVEMENT, + USER_BASE, + USER_MOVEMENT_AND_BASE +} UserModes; + + +typedef enum MovementModes { + VERTICAL_UP, + VERTICAL_DOWN, + HORIZONTAL_FORWARD, + HORIZONTAL_BACKWARDS, + RADIAL_CLOCKWISE, + RADIAL_COUNTERCLOCKWISE, + BARREL_CLOCKWISE, + BARREL_COUNTERCLOCKWISE, + ALL, + OFF +} MovementModes; + +typedef enum DitherMode { + FADE_IN, + FADE_OUT_AND_IN, + FADE_IN_AND_OUT, + FIXED, + CROSSFADE, + PULSED_INTENSITY, + OVERSHOOT +} DitherMode; + +typedef enum MovementFills { + LINE, + BAND, + FILL +} MovementFills; + +typedef enum EffectTypes { + CONSTANT, + RANDOM, // parameter is longest time between updates + SEQUENCE, // parameter is time step between updates + FIXED_RANDOM, // no parameter + RANDOM_STROBE // parameter is longest time between strobes +} EffectTypes; + +void setOverlayEffect( int movementMode, int ditherMode, int movementFill, int effectType, const int* colorList, int timeConstant, int moveTimeConstant ); +void setBaseEffect( int ditherMode, int effectType, const int* colorList, int timeConstant ); + +int movementToEnum(char* input); +int ditherToEnum(char* input); +int fillToEnum(char* input); +int effectToEnum(char* input); +const int* colorListToPointer(char* input); + + +#endif // SEQUENCER_H \ No newline at end of file