View Raw SPL
/*****************************************************************************
*                                                                            *
*   WEBCOLORS.SPL Copyright (C) 2008 DSP Development Corporation             *
*                               All Rights Reserved                          *
*                                                                            *
*   Author:       Randy Race                                                 *
*                                                                            *
*   Synopsis:     Generates web colors                                       *
*                                                                            *
*   Revisions:    15 Nov 2008  RRR  Creation                                 *
*                                                                            *
*****************************************************************************/

#include 

#if @HELP_WEBCOLORS

    WEBCOLORS

    Purpose: Defines website compatible colors.

    Syntax:  WEBCOLORS

    Returns: Nothing, defines 128 new website compatible colors

    Example:
             webcolors
             W1: gnorm(1000, 1);setcolor(dodgerblue)

             128 web compatible colors are defined. The color of the random
             series in W1 is set to dodgerblue.

     Remarks:
             The defined colors are available as macros and strings for use
             by any function that requires a color macro or color string.

             The colors also automatically appear in dialog boxes that
             contain a color picker.

     See Also:
             Colorstr
             Defcolor
             Setcolor
             Strcolor
             Wincolor
#endif


/* define web compatible colors */
webcolors()
{
        webcolors_defcolor("AliceBlue"           , 240, 248, 255);
        webcolors_defcolor("AntiqueWhite"        , 250, 235, 215);
        webcolors_defcolor("Aquamarine"          , 127, 255, 212);
        webcolors_defcolor("Azure"               , 240, 255, 255);
        webcolors_defcolor("Beige"               , 245, 245, 220);
        webcolors_defcolor("Bisque"              , 255, 228, 196);
        webcolors_defcolor("BlanchedAlmond"      , 255, 255, 205);
        webcolors_defcolor("BlueViolet"          , 138,  43, 226);
        webcolors_defcolor("Burlywood"           , 222, 184, 135);
        webcolors_defcolor("CadetBlue"           ,  95, 158, 160);
        webcolors_defcolor("Chartreuse"          , 127, 255,   0);
        webcolors_defcolor("Chocolate"           , 210, 105,  30);
        webcolors_defcolor("Coral"               , 255, 127,  80);
        webcolors_defcolor("CornflowerBlue"      , 100, 149, 237);
        webcolors_defcolor("Cornsilk"            , 255, 248, 220);
        webcolors_defcolor("Crimson"             , 220,  20,  60);
        webcolors_defcolor("DarkCyan"            ,   0, 139, 139);
        webcolors_defcolor("DarkGoldenRod"       , 184, 134,  11);
        webcolors_defcolor("DarkGray"            , 169, 169, 169);
        webcolors_defcolor("DarkGreen"           ,   0, 100,   0);
        webcolors_defcolor("DarkKhaki"           , 189, 183, 107);
        webcolors_defcolor("DarkMagenta"         , 139,   0, 139);
        webcolors_defcolor("DarkOliveGreen"      ,  85, 107,  47);
        webcolors_defcolor("DarkOrange"          , 255, 140,   0);
        webcolors_defcolor("DarkOrchid"          , 153,  50, 204);
        webcolors_defcolor("DarkSalmon"          , 233, 150, 122);
        webcolors_defcolor("DarkSeaGreen"        , 143, 188, 143);
        webcolors_defcolor("DarkSlateBlue"       ,  72,  61, 139);
        webcolors_defcolor("DarkSlateGray"       ,  47,  79,  79);
        webcolors_defcolor("DarkTurquoise"       ,   0, 206, 209);
        webcolors_defcolor("DarkViolet"          , 148,   0, 211);
        webcolors_defcolor("DeepPink"            , 255,  20, 147);
        webcolors_defcolor("DeepSkyBlue"         ,   0, 191, 255);
        webcolors_defcolor("DimGray"             , 105, 105, 105);
        webcolors_defcolor("DodgerBlue"          ,  30, 144, 255);
        webcolors_defcolor("FireBrick"           , 178,  34,  34);
        webcolors_defcolor("FloralWhite"         , 255, 250, 240);
        webcolors_defcolor("ForestGreen"         ,  34, 139, 34);
        webcolors_defcolor("Fuchsia"             , 255,   0, 255);
        webcolors_defcolor("Gainsboro"           , 220, 220, 220);
        webcolors_defcolor("GhostWhite"          , 248, 248, 255);
        webcolors_defcolor("Gold"                , 255, 215,   0);
        webcolors_defcolor("GoldenRod"           , 218, 165,  32);
        webcolors_defcolor("StandardGray"        , 127, 127, 127);
        webcolors_defcolor("GreenYellow"         , 173, 255,  47);
        webcolors_defcolor("GoldenRodYellow",      250, 250, 210);
        webcolors_defcolor("HoneyDew"            , 240, 255, 240);
        webcolors_defcolor("HotPink"             , 255, 105, 180);
        webcolors_defcolor("IndianRed"           , 205,  92,  92);
        webcolors_defcolor("Indigo"              ,  75,   0, 130);
        webcolors_defcolor("Ivory"               , 255, 255, 240);
        webcolors_defcolor("Khaki"               , 240, 230, 140);
        webcolors_defcolor("Lavender"            , 230, 230, 250);
        webcolors_defcolor("LavenderBlush"       , 255, 240, 245);
        webcolors_defcolor("Lawngreen"           , 124, 252,   0);
        webcolors_defcolor("LemonChiffon"        , 255, 250, 205);
        webcolors_defcolor("LightBlue"           , 173, 216, 230);
        webcolors_defcolor("LightCoral"          , 240, 128, 128);
        webcolors_defcolor("LightCyan"           , 224, 255, 255);
        webcolors_defcolor("LightGreen"          , 144, 238, 144);
        webcolors_defcolor("LightGrey"           , 211, 211, 211);
        webcolors_defcolor("LightPink"           , 255, 182, 193);
        webcolors_defcolor("LightSalmon"         , 255, 160, 122);
        webcolors_defcolor("LightSeaGreen"       ,  32, 178, 170);
        webcolors_defcolor("LightSkyBlue"        , 135, 206, 250);
        webcolors_defcolor("LightSlateGray"      , 119, 136, 153);
        webcolors_defcolor("LightSteelBlue"      , 176, 196, 222);
        webcolors_defcolor("LightYellow"         , 255, 255, 224);
        webcolors_defcolor("Lime"                ,   0, 255,   0);
        webcolors_defcolor("LimeGreen"           ,  50, 205,  50);
        webcolors_defcolor("Linen"               , 250, 240, 230);
        webcolors_defcolor("Magenta"             , 255,   0, 255);
        webcolors_defcolor("Maroon"              , 128,   0,  0);
        webcolors_defcolor("MediumAqua"          , 102, 205, 170);
        webcolors_defcolor("MediumBlue"          ,   0,   0, 205);
        webcolors_defcolor("MediumGreen"          ,  0, 250, 154);
        webcolors_defcolor("MediumOrchid"        , 186,  85, 211);
        webcolors_defcolor("MediumPurple"        , 147, 112, 219);
        webcolors_defcolor("MediumSeaGreen"      ,  60, 179, 113);
        webcolors_defcolor("MediumSlateBlue"     , 123, 104, 238);
        webcolors_defcolor("MediumTurquoise"     ,  72, 209, 204);
        webcolors_defcolor("MediumVioletRed"     , 199,  21, 133);
        webcolors_defcolor("MidnightBlue"        ,  25,  25, 112);
        webcolors_defcolor("MintCream"           , 245, 255, 250);
        webcolors_defcolor("MistyRose"           , 255, 228, 225);
        webcolors_defcolor("Moccasin"            , 255, 228, 181);
        webcolors_defcolor("NavajoWhite"         , 255, 222, 173);
        webcolors_defcolor("Navy"                ,   0,   0, 128);
        webcolors_defcolor("Navyblue"            , 159, 175, 223);
        webcolors_defcolor("OldLace"             , 253, 245, 230);
        webcolors_defcolor("Olive"               , 128, 128,   0);
        webcolors_defcolor("OliveDrab"           , 107, 142,  35);
        webcolors_defcolor("Orange"              , 255, 165,   0);
        webcolors_defcolor("OrangeRed"           , 255, 69,    0);
        webcolors_defcolor("Orchid"              , 218, 112, 214);
        webcolors_defcolor("PaleGoldenRod"       , 238, 232, 170);
        webcolors_defcolor("PaleGreen"           , 152, 251, 152);
        webcolors_defcolor("PaleTurquoise"       , 175, 238, 238);
        webcolors_defcolor("PaleVioletRed"       , 219, 112, 147);
        webcolors_defcolor("PapayaWhip"          , 255, 239, 213);
        webcolors_defcolor("PeachPuff"           , 255, 218, 185);
        webcolors_defcolor("Peru"                , 205, 133,  63);
        webcolors_defcolor("StandardPink"        , 255, 192, 203);
        webcolors_defcolor("Plum"                , 221, 160, 221);
        webcolors_defcolor("PowderBlue"          , 176, 224, 230);
        webcolors_defcolor("Purple"              , 128,   0, 128);
        webcolors_defcolor("RedWood"             , 164,  90,  82);
        webcolors_defcolor("RosyBrown"           , 188, 143, 143);
        webcolors_defcolor("RoyalBlue"           ,  65, 105, 225);
        webcolors_defcolor("SaddleBrown"         , 139,  69,  19);
        webcolors_defcolor("Salmon"              , 250, 128, 114);
        webcolors_defcolor("SandyBrown"          , 244, 164,  96);
        webcolors_defcolor("SeaGreen"            ,  46, 139,  87);
        webcolors_defcolor("SeaShell"            , 255, 245, 238);
        webcolors_defcolor("Sienna"              , 160,  82,  45);
        webcolors_defcolor("Silver"              , 192, 192, 192);
        webcolors_defcolor("SkyBlue"             , 135, 206, 235);
        webcolors_defcolor("SlateBlue"           , 106,  90, 205);
        webcolors_defcolor("SlateGray"           , 112, 128, 144);
        webcolors_defcolor("Snow"                , 255, 250, 250);
        webcolors_defcolor("SpringGreen"         ,   0, 255, 127);
        webcolors_defcolor("StandardTan"         , 210, 180, 140);
        webcolors_defcolor("SteelBlue"           ,  70, 130, 180);
        webcolors_defcolor("Thistle"             , 216, 191, 216);
        webcolors_defcolor("Tomato"              , 255,  99,  71);
        webcolors_defcolor("Turquoise"           ,  64, 224, 208);
        webcolors_defcolor("Wheat"               , 245, 222, 179);
        webcolors_defcolor("WhiteSmoke"          , 245, 245, 245);
        webcolors_defcolor("YellowGreen"         , 139, 205,  50);
        webcolors_defcolor("Yuma"                , 206, 194, 145);
}


webcolors_defcolor(name, r, g, b)
{
        local idx;

        /* get existing color index if any */
        idx = colorstr(name);

        /* define color */
        defcolor(name, r, g, b, idx);
}