From f7bc1df85d65c08cc05388410308fe5ef36447bd Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Tue, 14 Apr 2026 20:46:24 +0800 Subject: [PATCH] css: support 140 colors all --- examples/style.css | 2 +- html/abc_css_color.c | 214 +++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 208 insertions(+), 8 deletions(-) diff --git a/examples/style.css b/examples/style.css index 6cca9a1..f853881 100644 --- a/examples/style.css +++ b/examples/style.css @@ -11,7 +11,7 @@ a {text-decoration:none;} #a /*css comment*/ { - color:blue; + color:gold; text-align:center; } diff --git a/html/abc_css_color.c b/html/abc_css_color.c index 515f28c..974b8ba 100644 --- a/html/abc_css_color.c +++ b/html/abc_css_color.c @@ -20,7 +20,7 @@ static char* css_BlanchedAlmond[] = {"blanchedalmond", NULL}; static char* css_blue[] = {"blue", "蓝", NULL}; static char* css_BlueViolet[] = {"blueviolet", NULL}; -static char* css_brown[] = {"brown", NULL}; +static char* css_brown[] = {"brown", "棕", NULL}; static char* css_BurlyWood[] = {"burlywood", NULL}; static char* css_CadetBlue[] = {"cadetblue", NULL}; static char* css_Chartreuse[] = {"chartreuse", NULL}; @@ -28,19 +28,19 @@ static char* css_Chocolate[] = {"chocolate", NULL}; static char* css_Coral[] = {"coral", NULL}; static char* css_CornflowerBlue[] = {"cornflowerblue", NULL}; static char* css_Cornsilk[] = {"cornsilk", NULL}; -static char* css_Crimson[] = {"crimson", NULL}; +static char* css_Crimson[] = {"crimson", "深红", "绯红", NULL}; static char* css_Cyan[] = {"cyan", NULL}; -static char* css_DarkBlue[] = {"darkblue", NULL}; +static char* css_DarkBlue[] = {"darkblue", "深蓝", "黛蓝", NULL}; static char* css_DarkCyan[] = {"darkcyan", NULL}; static char* css_DarkGoldenRod[] = {"darkgoldenrod", NULL}; static char* css_DarkGray[] = {"darkgray", NULL}; -static char* css_DarkGreen[] = {"darkgreen", NULL}; +static char* css_DarkGreen[] = {"darkgreen", "暗绿", NULL}; static char* css_DarkKhaki[] = {"darkkhaki", NULL}; static char* css_DarkMagenta[] = {"darkmagenta", NULL}; static char* css_DarkOliveGreen[] = {"darkolivegreen", NULL}; static char* css_DarkOrange[] = {"darkorange", NULL}; static char* css_DarkOrchid[] = {"darkorchid", NULL}; -static char* css_DarkRed[] = {"darkred", NULL}; +static char* css_DarkRed[] = {"darkred", "暗红", NULL}; static char* css_DarkSalmon[] = {"darksalmon", NULL}; static char* css_DarkSeaGreen[] = {"darkseagreen", NULL}; static char* css_DarkSlateBlue[] = {"darkslateblue", NULL}; @@ -56,10 +56,110 @@ static char* css_FloralWhite[] = {"floralwhite", NULL}; static char* css_ForestGreen[] = {"forestgreen", NULL}; static char* css_fuchsia[] = {"fuchsia", "紫红", "洋红", NULL}; +static char* css_Gainsboro[] = {"Gainsboro", NULL}; +static char* css_GhostWhite[] = {"GhostWhite", NULL}; +static char* css_Gold[] = {"Gold", "金", "金黄", NULL}; +static char* css_GoldenRod[] = {"GoldenRod", NULL}; +static char* css_Gray[] = {"Gray", "灰", NULL}; static char* css_green[] = {"green", "绿", NULL}; -static char* css_red[] = {"red", "红", NULL}; +static char* css_GreenYellow[] = {"GreenYellow", "黄绿", NULL}; +static char* css_HoneyDew[] = {"HoneyDew", NULL}; +static char* css_HotPink[] = {"HotPink", NULL}; +static char* css_IndianRed[] = {"IndianRed", NULL}; +static char* css_Indigo[] = {"Indigo", NULL}; +static char* css_Ivory[] = {"Ivory", NULL}; +static char* css_Khaki[] = {"Khaki", NULL}; +static char* css_Lavender[] = {"Lavender", NULL}; +static char* css_LavenderBlush[] = {"LavenderBlush", NULL}; +static char* css_LawnGreen[] = {"LawnGreen", NULL}; +static char* css_LemonChiffon[] = {"LemonChiffon", NULL}; +static char* css_LightBlue[] = {"LightBlue", NULL}; +static char* css_LightCoral[] = {"LightCoral", NULL}; +static char* css_LightCyan[] = {"LightCyan", NULL}; +static char* css_LightGoldenRodYellow[] = {"LightGoldenRodYellow", NULL}; + +static char* css_LightGray[] = {"LightGray", "浅灰", NULL}; +static char* css_LightGreen[] = {"LightGreen", "浅绿", NULL}; +static char* css_LightPink[] = {"LightPink", NULL}; +static char* css_LightSalmon[] = {"LightSalmon", NULL}; +static char* css_LightSeaGreen[] = {"LightSeaGreen", "浅海绿", NULL}; +static char* css_LightSkyBlue[] = {"LightSkyBlue", "浅天蓝", NULL}; +static char* css_LightSlateGray[] = {"LightSlateGray", NULL}; +static char* css_LightSteelBlue[] = {"LightSteelBlue", NULL}; +static char* css_LightYellow[] = {"LightYellow", "浅黄", NULL}; +static char* css_Lime[] = {"Lime", NULL}; +static char* css_LimeGreen[] = {"LimeGreen", NULL}; +static char* css_Linen[] = {"Linen", NULL}; + +static char* css_magenta[] = {"Magenta", "品红", "洋红", NULL}; +static char* css_Maroon[] = {"Maroon", NULL}; +static char* css_MediumAquaMarine[] = {"MediumAquaMarine", NULL}; +static char* css_MediumBlue[] = {"MediumBlue", "中蓝", NULL}; +static char* css_MediumOrchid[] = {"MediumOrchid", NULL}; +static char* css_MediumPurple[] = {"MediumPurple", "中紫", NULL}; +static char* css_MediumSeaGreen[] = {"MediumSeaGreen", "中海绿", NULL}; +static char* css_MediumSlateBlue[] = {"MediumSlateBlue", NULL}; +static char* css_MediumSpringGreen[] = {"MediumSpringGreen", "中春绿", NULL}; +static char* css_MediumTurquoise[] = {"MediumTurquoise", NULL}; +static char* css_MediumVioletRed[] = {"MediumVioletRed", NULL}; +static char* css_MidnightBlue[] = {"MidnightBlue", NULL}; + +static char* css_MintCream[] = {"MintCream", NULL}; +static char* css_MistyRose[] = {"MistyRose", NULL}; +static char* css_Moccasin[] = {"Moccasin", NULL}; +static char* css_NavajoWhite[] = {"NavajoWhite", NULL}; +static char* css_Navy[] = {"Navy", "海军蓝", NULL}; +static char* css_OldLace[] = {"OldLace", NULL}; +static char* css_Olive[] = {"Olive", "橄榄绿", NULL}; +static char* css_OliveDrab[] = {"OliveDrab", NULL}; + +static char* css_orange[] = {"Orange", "橘", NULL}; +static char* css_OrangeRed[] = {"OrangeRed", "橘红", NULL}; +static char* css_Orchid[] = {"Orchid", "淡紫", "兰花紫", NULL}; +static char* css_PaleGoldenRod[] = {"PaleGoldenRod", NULL}; +static char* css_PaleGreen[] = {"PaleGreen", NULL}; +static char* css_PaleTurquoise[] = {"PaleTurquoise", NULL}; +static char* css_PaleVioletRed[] = {"PaleVioletRed", NULL}; +static char* css_PapayaWhip[] = {"PapayaWhip", NULL}; +static char* css_PeachPuff[] = {"PeachPuff", NULL}; +static char* css_Peru[] = {"Peru", NULL}; + +static char* css_pink[] = {"Pink", "粉红", NULL}; +static char* css_Plum[] = {"Plum", NULL}; +static char* css_PowderBlue[] = {"PowderBlue", NULL}; + +static char* css_purple[] = {"Purple", "紫", NULL}; +static char* css_red[] = {"red", "红", NULL}; +static char* css_RosyBrown[] = {"RosyBrown", NULL}; +static char* css_RoyalBlue[] = {"RoyalBlue", NULL}; +static char* css_SaddleBrown[] = {"SaddleBrown", NULL}; +static char* css_Salmon[] = {"Salmon", NULL}; +static char* css_SandyBrown[] = {"SandyBrown", NULL}; +static char* css_SeaGreen[] = {"SeaGreen", "海绿", NULL}; +static char* css_SeaShell[] = {"SeaShell", NULL}; +static char* css_Sienna[] = {"Sienna", NULL}; +static char* css_Silver[] = {"Silver", "银", NULL}; +static char* css_SkyBlue[] = {"SkyBlue", "天蓝", NULL}; +static char* css_SlateBlue[] = {"SlateBlue", NULL}; +static char* css_SlateGray[] = {"SlateGray", NULL}; +static char* css_Snow[] = {"Snow", "雪白", NULL}; +static char* css_SpringGreen[] = {"SpringGreen", "春绿", NULL}; +static char* css_SteelBlue[] = {"SteelBlue", NULL}; + +static char* css_Tan[] = {"Tan", NULL}; +static char* css_Teal[] = {"Teal", NULL}; +static char* css_Thistle[] = {"Thistle", NULL}; +static char* css_Tomato[] = {"Tomato", "西红柿", NULL}; +static char* css_Turquoise[] = {"Turquoise", NULL}; +static char* css_Violet[] = {"Violet", "紫罗兰", NULL}; +static char* css_Wheat[] = {"Wheat", NULL}; + static char* css_white[] = {"white", "白", NULL}; +static char* css_WhiteSmoke[] = {"WhiteSmoke", NULL}; + +static char* css_yellow[] = {"yellow", "黄", NULL}; +static char* css_YellowGreen[] = {"YellowGreen", "绿黄", NULL}; static css_color_t css_colors[] = { @@ -113,10 +213,110 @@ static css_color_t css_colors[] = {css_ForestGreen, 0x228b22}, {css_fuchsia, 0xff00ff}, + {css_Gainsboro, 0xdcdcdc}, + {css_GhostWhite, 0xf8f8ff}, + {css_Gold, 0xffd700}, + {css_GoldenRod, 0xdaa520}, + {css_Gray, 0x808080}, - {css_green, 0x00ff00}, + {css_green, 0x008000}, + {css_GreenYellow, 0xadff2f}, + {css_HoneyDew, 0xf0fff0}, + {css_HotPink, 0xff69b4}, + {css_IndianRed, 0xcd5c5c}, + {css_Indigo, 0x4b0082}, + {css_Ivory, 0xfffff0}, + {css_Khaki, 0xf0e68c}, + {css_Lavender, 0xe6e6fa}, + {css_LavenderBlush, 0xfff0f5}, + {css_LawnGreen, 0x7cfc00}, + {css_LemonChiffon, 0xfffacd}, + {css_LightBlue, 0xadd8e6}, + {css_LightCoral, 0xf08080}, + {css_LightCyan, 0xe0ffff}, + {css_LightGoldenRodYellow, 0xfafad2}, + + {css_LightGray, 0xd3d3d3}, + {css_LightGreen, 0x90ee90}, + {css_LightPink, 0xffb6c1}, + {css_LightSalmon, 0xffa07a}, + {css_LightSeaGreen, 0x20b2aa}, + {css_LightSkyBlue, 0x87cefa}, + {css_LightSlateGray, 0x778899}, + {css_LightSteelBlue, 0xb0c4de}, + {css_LightYellow, 0xffffe0}, + {css_Lime, 0x00ff00}, + {css_LimeGreen, 0x32cd32}, + {css_Linen, 0xfaf0e6}, + + {css_magenta, 0xff00ff}, + {css_Maroon, 0x800000}, + {css_MediumAquaMarine, 0x66cdaa}, + + {css_MediumBlue, 0x0000cd}, + {css_MediumOrchid, 0xba55d3}, + {css_MediumPurple, 0x9370db}, + {css_MediumSeaGreen, 0x3cb371}, + {css_MediumSlateBlue, 0x7b68ee}, + {css_MediumSpringGreen, 0x00fa9a}, + + {css_MediumTurquoise, 0x48d1cc}, + {css_MediumVioletRed, 0xc71585}, + {css_MidnightBlue, 0x191970}, + {css_MintCream, 0xf5fffa}, + {css_MistyRose, 0xffe4e1}, + {css_Moccasin, 0xffe4b5}, + {css_NavajoWhite, 0xffdead}, + {css_Navy, 0x000080}, + {css_OldLace, 0xfdf5e6}, + {css_Olive, 0x808000}, + {css_OliveDrab, 0x6b8e23}, + + {css_orange, 0xffa500}, + {css_OrangeRed, 0xff4500}, + {css_Orchid, 0xda70d6}, + {css_PaleGoldenRod, 0xeee8aa}, + {css_PaleGreen, 0x98fb98}, + {css_PaleTurquoise, 0xafeeee}, + {css_PaleVioletRed, 0xdb7093}, + {css_PapayaWhip, 0xffefd5}, + {css_PeachPuff, 0xffdab9}, + {css_Peru, 0xcd853f}, + + {css_pink, 0xffc0cb}, + {css_Plum, 0xdda0dd}, + {css_PowderBlue, 0xb0e0e6}, + + {css_purple, 0x800080}, {css_red, 0xff0000}, + {css_RosyBrown, 0xbc8f8f}, + {css_RoyalBlue, 0x4169e1}, + {css_SaddleBrown, 0x8b4513}, + {css_Salmon, 0xfa8072}, + {css_SandyBrown, 0xf4a460}, + {css_SeaGreen, 0x2e8b57}, + {css_SeaShell, 0xfff5ee}, + {css_Sienna, 0xa0522d}, + {css_Silver, 0xc0c0c0}, + {css_SkyBlue, 0x87ceeb}, + {css_SlateBlue, 0x6a5acd}, + {css_SlateGray, 0x708090}, + {css_Snow, 0xfffafa}, + {css_SpringGreen, 0x00ff7f}, + {css_SteelBlue, 0x4682b4}, + {css_Tan, 0xd2b48c}, + {css_Teal, 0x008080}, + {css_Thistle, 0xd8bfd8}, + {css_Tomato, 0xff6347}, + {css_Turquoise, 0x40e0d0}, + {css_Violet, 0xee82ee}, + {css_Wheat, 0xf5deb3}, + {css_white, 0xffffff}, + {css_WhiteSmoke, 0xf5f5f5}, + + {css_yellow, 0xffff00}, + {css_YellowGreen, 0x9acd32}, }; int abc_css_color(double* r, double* g, double* b, const uint8_t* str) -- 2.25.1