• Color code and RGB values


    /*Poping color selection window.
    Here is an interesting piece of code for poping color selection window.
    */
    static void Jimmy_colorsChoose(Args _args)
    {
        #DEFINE.COLORVALUE (64)
        int             r, g, b;
        container       chosenColor;
        Binary          customColors = new Binary(#COLORVALUE);
        CCColor         colorValue;
    ;
        chosenColor = WinAPI::chooseColor(infolog.hWnd(), r, g, b, customColors, true);
        if (chosenColor)
        {
            [r, g, b] = chosenColor;
            colorValue  = WinAPI::RGB2int(r, g, b);
            print (colorValue);
            pause;
        }
    }
    
    Wrote by Jimmy on July 16th 2010
    1) Hexadecimal turn to Decimal (RGB 0-255) sytem custom functions.
    View Code
    static void Jimmy_hex2RGB(Args _args)//hexadecimal Converted to RGB
    {
    Container c;
    Dialog Dialog
    = new Dialog("Hex converted to RGB!");

    DialogField dlgFex
    = Dialog.addField(types::String,"hexadecimal format",'PS:FFBBAA');

    int m;
    str
    20 ps,Fex;

    Container hex2RGB(str
    50 Hexstr)
    {
    Container con;
    int len,i;
    str
    50 st;
    ;
    st
    = global::StrDelete(Hexstr,'#');
    st
    = global::strLRTrim(st);

    st
    = substr(st,1,6);
    len
    = strlen(st);
    info(st
    + '..' + int2str(len)) ;

    for(i = 1; i <= len; i += 2)
    {
    Con
    += [hex2Int(substr(st,i,2))];

    }
    return Con;
    }
    ;

    setprefix(
    'RGB');
    Dialog.doInit();
    if(!Dialog.run())
    return ;

    Fex
    = dlgFex.value();
    c
    = hex2RGB(Fex);
    for(m = 1 ; m <= Conlen(c); m++)
    {
    if(!ps)
    ps
    = int2str(conpeek(c,m));
    else
    ps
    += ',' + int2str(conpeek(c,m));

    }

    info(strfmt(
    "'%1' %2 '%3'",Fex, 'Turn to RGB is',ps));
    }

    2) RGB(decimal 0-255) turn to Hexadecimal sytem custom functions.
    View Code
    static void Jimmy_int2Hex(Args _args)//int(255) Converted to Hex
    {
    Dialog Dialog
    = new Dialog("Integer converted to Hex!");
    DialogField dlgInt
    = Dialog.addField(types::String,"Integer format",'PS:255,255,255');
    str
    50 ps,Intx;

    Str
    50 int2Hex(str 50 _IntStr)
    {
    int ints;
    str
    50 st;
    List list;
    ListEnumerator le;
    ;

    list
    = global::strSplit(_IntStr,',');
    le
    = list.getEnumerator();
    while(le.moveNext())
    {
    ints
    = str2int(le.current());
    if(ints > 255)
    throw Error("Data Over For RGB Hex!");

    if(!st)
    st
    = global::int2Hex(ints);//ints div 16 + ints mod 16
    else
    st
    += ',' + global::int2Hex(ints);
    }
    return st;
    }
    ;
    setprefix(
    'Int2Hex');
    Dialog.doInit();
    if(!Dialog.run())
    return ;
    Intx
    = global::strLRTrim(dlgInt.value());
    if(strlen(Intx) > 11)
    throw Error("format is error! For example 255,255,255");

    ps
    = int2Hex(Intx);//Calc method

    info(strfmt(
    "'%1' %2 '%3'",Intx, ' Turn to Hex is ',ps));
    }
    
    
    000000 000033 000066 000099 0000CC 0000FF
    003300 003333 003366 003399 0033CC 0033FF
    006600 006633 006666 006699 0066CC 0066FF
    009900 009933 009966 009999 0099CC 0099FF
    00CC00 00CC33 00CC66 00CC99 00CCCC 00CCFF
    00FF00 00FF33 00FF66 00FF99 00FFCC 00FFFF
    330000 330033 330066 330099 3300CC 3300FF
    333300 333333 333366 333399 3333CC 3333FF
    336600 336633 336666 336699 3366CC 3366FF
    339900 339933 339966 339999 3399CC 3399FF
    33CC00 33CC33 33CC66 33CC99 33CCCC 33CCFF
    33FF00 33FF33 33FF66 33FF99 33FFCC 33FFFF
    660000 660033 660066 660099 6600CC 6600FF
    663300 663333 663366 663399 6633CC 6633FF
    666600 666633 666666 666699 6666CC 6666FF
    669900 669933 669966 669999 6699CC 6699FF
    66CC00 66CC33 66CC66 66CC99 66CCCC 66CCFF
    66FF00 66FF33 66FF66 66FF99 66FFCC 66FFFF
    990000 990033 990066 990099 9900CC 9900FF
    993300 993333 993366 993399 9933CC 9933FF
    996600 996633 996666 996699 9966CC 9966FF
    999900 999933 999966 999999 9999CC 9999FF
    99CC00 99CC33 99CC66 99CC99 99CCCC 99CCFF
    99FF00 99FF33 99FF66 99FF99 99FFCC 99FFFF
    CC0000 CC0033 CC0066 CC0099 CC00CC CC00FF
    CC3300 CC3333 CC3366 CC3399 CC33CC CC33FF
    CC6600 CC6633 CC6666 CC6699 CC66CC CC66FF
    CC9900 CC9933 CC9966 CC9999 CC99CC CC99FF
    CCCC00 CCCC33 CCCC66 CCCC99 CCCCCC CCCCFF
    CCFF00 CCFF33 CCFF66 CCFF99 CCFFCC CCFFFF
    FF0000 FF0033 FF0066 FF0099 FF00CC FF00FF
    FF3300 FF3333 FF3366 FF3399 FF33CC FF33FF
    FF6600 FF6633 FF6666 FF6699 FF66CC FF66FF
    FF9900 FF9933 FF9966 FF9999 FF99CC FF99FF
    FFCC00 FFCC33 FFCC66 FFCC99 FFCCCC FFCCFF
    FFFF00 FFFF33 FFFF66 FFFF99 FFFFCC FFFFFF

    RGB颜色对照表

    #FFFFFF #FFFFF0 #FFFFE0 #FFFF00
    #FFFAFA #FFFAF0 #FFFACD #FFF8DC
    #FFF68F #FFF5EE #FFF0F5 #FFEFDB
    #FFEFD5 #FFEC8B #FFEBCD #FFE7BA
    #FFE4E1 #FFE4C4 #FFE4B5 #FFE1FF
    #FFDEAD #FFDAB9 #FFD700 #FFD39B
    #FFC1C1 #FFC125 #FFC0CB #FFBBFF
    #FFB90F #FFB6C1 #FFB5C5 #FFAEB9
    #FFA54F #FFA500 #FFA07A #FF8C69
    #FF8C00 #FF83FA #FF82AB #FF8247
    #FF7F50 #FF7F24 #FF7F00 #FF7256
    #FF6EB4 #FF6A6A #FF69B4 #FF6347
    #FF4500 #FF4040 #FF3E96 #FF34B3
    #FF3030 #FF1493 #FF00FF #FF0000
    #FDF5E6 #FCFCFC #FAFAFA #FAFAD2
    #FAF0E6 #FAEBD7 #FA8072 #F8F8FF
    #F7F7F7 #F5FFFA #F5F5F5 #F5F5DC
    #F5DEB3 #F4F4F4 #F4A460 #F2F2F2
    #F0FFFF #F0FFF0 #F0F8FF #F0F0F0
    #F0E68C #F08080 #EEEEE0 #EEEED1
    #EEEE00 #EEE9E9 #EEE9BF #EEE8CD
    #EEE8AA #EEE685 #EEE5DE #EEE0E5
    #EEDFCC #EEDC82 #EED8AE #EED5D2
    #EED5B7 #EED2EE #EECFA1 #EECBAD
    #EEC900 #EEC591 #EEB4B4 #EEB422
    #EEAEEE #EEAD0E #EEA9B8 #EEA2AD
    #EE9A49 #EE9A00 #EE9572 #EE82EE
    #EE8262 #EE7AE9 #EE799F #EE7942
    #EE7621 #EE7600 #EE6AA7 #EE6A50
    #EE6363 #EE5C42 #EE4000 #EE3B3B
    #EE3A8C #EE30A7 #EE2C2C #EE1289
    #EE00EE #EE0000 #EDEDED #EBEBEB
    #EAEAEA #E9967A #E8E8E8 #E6E6FA
    #E5E5E5 #E3E3E3 #E0FFFF #E0EEEE
    #E0EEE0 #E0E0E0 #E066FF #DEDEDE
    #DEB887 #DDA0DD #DCDCDC #DC143C
    #DBDBDB #DB7093 #DAA520 #DA70D6
    #D9D9D9 #D8BFD8 #D6D6D6 #D4D4D4
    #D3D3D3 #D2B48C #D2691E #D1EEEE
    #D1D1D1 #D15FEE #D02090 #CFCFCF
    #CDCDC1 #CDCDB4 #CDCD00 #CDC9C9
    #CDC9A5 #CDC8B1 #CDC673 #CDC5BF
    #CDC1C5 #CDC0B0 #CDBE70 #CDBA96
    #CDB7B5 #CDB79E #CDB5CD #CDB38B
    #CDAF95 #CDAD00 #CDAA7D #CD9B9B
    #CD9B1D #CD96CD #CD950C #CD919E
    #CD8C95 #CD853F #CD8500 #CD8162
    #CD7054 #CD69C9 #CD6889 #CD6839
    #CD661D #CD6600 #CD6090 #CD5C5C
    #CD5B45 #CD5555 #CD4F39 #CD3700
    #CD3333 #CD3278 #CD2990 #CD2626
    #CD1076 #CD00CD #CD0000 #CCCCCC
    #CAFF70 #CAE1FF #C9C9C9 #C7C7C7
    #C71585 #C6E2FF #C67171 #C5C1AA
    #C4C4C4 #C2C2C2 #C1FFC1 #C1CDCD
    #C1CDC1 #C1C1C1 #C0FF3E #BFEFFF
    #BFBFBF #BF3EFF #BEBEBE #BDBDBD
    #BDB76B #BCEE68 #BCD2EE #BC8F8F
    #BBFFFF #BABABA #BA55D3 #B9D3EE
    #B8B8B8 #B8860B #B7B7B7 #B5B5B5
    #B4EEB4 #B4CDCD #B452CD #B3EE3A
    #B3B3B3 #B2DFEE #B23AEE #B22222
    #B0E2FF #B0E0E6 #B0C4DE #B0B0B0
    #B03060 #AEEEEE #ADFF2F #ADD8E6
    #ADADAD #ABABAB #AB82FF #AAAAAA
    #A9A9A9 #A8A8A8 #A6A6A6 #A52A2A
    #A4D3EE #A3A3A3 #A2CD5A #A2B5CD
    #A1A1A1 #A0522D #A020F0 #9FB6CD
    #9F79EE #9E9E9E #9C9C9C #9BCD9B
    #9B30FF #9AFF9A #9ACD32 #9AC0CD
    #9A32CD #999999 #9932CC #98FB98
    #98F5FF #97FFFF #96CDCD #969696
    #949494 #9400D3 #9370DB #919191
    #912CEE #90EE90 #8FBC8F #8F8F8F
    #8EE5EE #8E8E8E #8E8E38 #8E388E
    #8DEEEE #8DB6CD #8C8C8C #8B8B83
    #8B8B7A #8B8B00 #8B8989 #8B8970
    #8B8878 #8B8682 #8B864E #8B8386
    #8B8378 #8B814C #8B7E66 #8B7D7B
    #8B7D6B #8B7B8B #8B795E #8B7765
    #8B7500 #8B7355 #8B6969 #8B6914
    #8B668B #8B6508 #8B636C #8B5F65
    #8B5A2B #8B5A00 #8B5742 #8B4C39
    #8B4789 #8B475D #8B4726 #8B4513
    #8B4500 #8B3E2F #8B3A62 #8B3A3A
    #8B3626 #8B2500 #8B2323 #8B2252
    #8B1C62 #8B1A1A #8B0A50 #8B008B
    #8B0000 #8A8A8A #8A2BE2 #8968CD
    #87CEFF #87CEFA #87CEEB #878787
    #858585 #848484 #8470FF #838B8B
    #838B83 #836FFF #828282 #7FFFD4
    #7FFF00 #7F7F7F #7EC0EE #7D9EC0
    #7D7D7D #7D26CD #7CFC00 #7CCD7C
    #7B68EE #7AC5CD #7A8B8B #7A7A7A
    #7A67EE #7A378B #79CDCD #787878
    #778899 #76EEC6 #76EE00 #757575
    #737373 #71C671 #7171C6 #708090
    #707070 #6E8B3D #6E7B8B #6E6E6E
    #6CA6CD #6C7B8B #6B8E23 #6B6B6B
    #6A5ACD #698B69 #698B22 #696969
    #6959CD #68838B #68228B #66CDAA
    #66CD00 #668B8B #666666 #6495ED
    #63B8FF #636363 #616161 #607B8B
    #5F9EA0 #5E5E5E #5D478B #5CACEE
    #5C5C5C #5B5B5B #595959 #575757
    #556B2F #555555 #551A8B #54FF9F
    #548B54 #545454 #53868B #528B8B
    #525252 #515151 #4F94CD #4F4F4F
    #4EEE94 #4D4D4D #4B0082 #4A708B
    #4A4A4A #48D1CC #4876FF #483D8B
    #474747 #473C8B #4682B4 #458B74
    #458B00 #454545 #43CD80 #436EEE
    #424242 #4169E1 #40E0D0 #404040
    #3D3D3D #3CB371 #3B3B3B #3A5FCD
    #388E8E #383838 #36648B #363636
    #333333 #32CD32 #303030 #2F4F4F
    #2E8B57 #2E2E2E #2B2B2B #292929
    #282828 #27408B #262626 #242424
    #228B22 #218868 #212121 #20B2AA
    #1F1F1F #1E90FF #1E1E1E #1C86EE
    #1C1C1C #1A1A1A #191970 #1874CD
    #171717 #141414 #121212 #104E8B
    #0F0F0F #0D0D0D #0A0A0A #080808
    #050505 #030303 #00FFFF #00FF7F
    #00FF00 #00FA9A #00F5FF #00EEEE
    #00EE76 #00EE00 #00E5EE #00CED1
    #00CDCD #00CD66 #00CD00 #00C5CD
    #00BFFF #00B2EE #009ACD #008B8B
    #008B45 #008B00 #00868B #00688B
    #006400 #0000FF #0000EE #0000CD
    #0000AA #00008B #000080 #000000

    古典白色 :古典白色antiquewhite
    浅绿色:浅绿色aqua
    碧绿色:碧绿色aquamarine
    天蓝色:天蓝色azure(汗。。。)
    米色:米色beige
    桔黄色:桔黄色bisque
    黑色:黑色black
    白杏色:白杏色blanchedalmond
    蓝色:蓝色blue
    蓝紫色:蓝紫色blueviolet
    褐色:褐色brown
    实木色:实木色burlywood
    刺桧蓝色:刺桧蓝色cadetblue
    亮黄绿色:亮黄绿色chartreuse
    巧克力色:巧克力色chocolate
    珊瑚色:珊瑚色coral
    矢车菊色:矢车菊色cornflowerblue
    谷丝色:谷丝色cornsilk
    深红色:深红色crimson
    蓝绿色:蓝绿色cyan
    深蓝色:深蓝色darkblue
    深青色:深青色darkcyan
    深金杆色:深金杆色darkgoldenrod
    深灰色:深灰色darkgray
    深绿色:深绿色darkgreen
    深黄褐色:深黄褐色darkkhaki
    深洋红色:深洋红色darkmagenta
    深橄榄绿色:深橄榄绿色darkolivegreen
    深橙色:深橙色darkorange
    深紫色:深紫色darkorchid
    深红色:深红色darkred
    深肉色:深肉色darksalmon
    深海绿色:深海绿色darkseagreen
    深暗灰蓝色:深暗灰蓝色darkslateblue
    深暗蓝灰色:深暗蓝灰色darkslategray
    深青绿色:深青绿色darkturquoise
    深紫色:深紫色darkviolet
    深粉色:深粉色deeppink
    深天蓝色:深天蓝色deepskyblue
    暗灰色:暗灰色dimgray
    遮板蓝色:遮板蓝色dodgerblue
    砖色:砖色firebrick
    花白色:花白色floralwhite
    葱绿色:葱绿色forestgreen
    紫红色:紫红色fushcia
    庚斯博罗灰色:庚斯博罗灰色gainsboro
    幽灵白色:幽灵白色ghostwhite
    金黄色:金黄色gold
    金杆黄色:金杆黄色goldenrod
    灰色:灰色gray
    绿色:绿色green
    绿黄色:绿黄色greenyellow
    蜜汁色:蜜汁色honeydew
    亮粉色:亮粉色hotpink
    印第安红色:印第安红色indianred
    靛青色:靛青色indigo
    象牙色:象牙色ivory
    黄褐色:黄褐色khaki
    淡紫色:淡紫色lavender
    浅紫红色:浅紫红色lavenderblush
    草绿色:草绿色lawngreen
    柠檬纱色:柠檬纱色lemonchiffon
    浅蓝色:浅蓝色lightblue
    浅珊瑚色:浅珊瑚色 lightcoral
    浅金杆黄色:浅金杆黄色lightgoldenrodyellow

  • 相关阅读:
    美国地质调研局USGS
    SAR 图像
    Matlab 之meshgrid, interp, griddata 用法和实例
    ENVISAT卫星及ASAR数据介绍
    ASP.NET Integration with IIS7
    ubuntu下C/C++基本开发环境的配置
    C++ Objects Part 1: Basic Object Memory Layout
    Socket Programming in Windows
    Memory Layout for Multiple and Virtual Inheritance
    Common Type System—Memory Layout at C# Online.NET
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1778851.html
Copyright © 2020-2023  润新知