⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 colors.c

📁 微型浏览器
💻 C
📖 第 1 页 / 共 2 页
字号:
      {"springgreen1", "5efb6e"},      {"palegoldenrod", "ede49e"},      {"palevioletred", "d16587"},      {"sienna", "8a4117"},      {"mistyrose", "fde1dd"},      {"mediumblue", "152dc6" },      {"indianred1", "f75d59" },      {"mediumpurple", "8467d7" },      {"midnightblue", "151b54"},      {"gold", "d4a017" },      {"mediumslateblue", "5e5a80" },      {"mediumturquoise", "48cccd" },      {"mediumaquamarine", "348781" },      {"goldenrod", "edda74" },      {"snow2", "ece7e6"},      {"salmon2", "e67451"},      {"sienna2", "e66c2c"},      {"skyblue2", "79baec"},      {"seagreen2", "64e986"},      {"seashell2", "ebe2d9"},      {"slateblue2", "6960ec"},      {"steelblue2", "56a5ec"},      {"slategray2", "b4cfec"},      {"springgreen2", "57e964"},      {"hotpink1", "f665ab" },      {"ivory2", "ececdc" },      {"indianred2", "e55451" },      {"skyblue", "6698ff"},      {"slateblue", "737ca1"},      {"steelblue", "4863a0"},      {"yellow1", "fffc17"},      {"cyan", "00ffff" },      {"navajowhite2", "eac995"},      {"hotpink2", "e45e9d" },      {"honeydew2", "deebdc" },      {"red1", "f62217"},      {"rosybrown1", "fbbbb9"},      {"royalblue1", "306eff"},      {"navajowhite", "fddaa3"},      {"plum1", "f9b7ff"},      {"purple1", "893bff"},      {"gainsboro", "d8d9d7" },      {"palegreen1", "a0fc8d"},      {"darkorchid", "7d1b7e" },      {"paleturquoise1", "bcfeff"},      {"darkgoldenrod", "af7817" },      {"gold1", "fdd017" },      {"gray61", "939190" },      {"gray51", "787473" },      {"gray41", "5c5858" },      {"gray31", "41383c" },      {"gray21", "2b1b17" },      {"green1", "5ffb17" },      {"gray91", "e5e6e4" },      {"gray81", "cacac9" },      {"gray71", "aeadac" },      {"red2", "e41b17"},      {"goldenrod1", "fbb917" },      {"blanchedalmond", "fee8c6" },      {"darkviolet", "842dce" },      {"rosybrown2", "e8adaa"},      {"royalblue2", "2b65ec"},      {"pink2", "e7a1b0"},      {"plum2", "e6a9ec"},      {"purple2", "7f38ec"},      {"palegreen2", "94e981"},      {"peachpuff2", "eac5a3"},      {"blueviolet", "7931df" },      {"paleturquoise2", "adebec"},      {"palevioletred2", "e56e94"},      {"gold2", "eac117" },      {"gray52", "7a7777" },      {"gray42", "5f5a59" },      {"gray32", "463e3f" },      {"green2", "59e817" },      {"gray92", "e8e9e8" },      {"gray82", "cccccb" },      {"gray72", "b1b1af" },      {"gray62", "959492" },      {"royalblue", "2b60de"},      {"goldenrod2", "e9ab17" },      {"purple", "8e35ef"},      {"powderblue", "addce3"},      {"paleturquoise", "aeebec"},      {"ghostwhite", "f7f7ff" },      {"orchid", "e57ded"},      {"orangered", "f63817"},      {"olivedrab", "658017"},      {"tomato", "f75431"},      {"darkorange1", "f87217" },      {"darkorchid1", "b041ff" },      {"darkseagreen1", "c3fdb8" },      {"darkgoldenrod1", "fbb117" },      {"darkslategray1", "9afeff" },      {"darkolivegreen1", "ccfb5d" },      {"blue1", "1535ff" },      {"brown1", "f63526" },      {"tan1", "fa9b3c"},      {"burlywood1", "fcce8e" },      {"thistle1", "fcdfff"},      {"turquoise1", "52f3ff"},      {"deeppink2", "e4287c" },      {"darkorange2", "e56717" },      {"dodgerblue2", "157dec" },      {"darkorchid2", "a23bec" },      {"deepskyblue2", "38acec" },      {"darkseagreen2", "b5eaaa" },      {"darkgoldenrod2", "e8a317" },      {"darkslategray2", "8eebec" },      {"darkolivegreen2", "bce954" },      {"blue2", "1531ec" },      {"brown2", "e42d17" },      {"bisque2", "ead0ae" },      {"tan2", "e78e35"},      {"burlywood2", "eabe83" },      {"tomato2", "e54c2c"},      {"thistle2", "e9cfec"},      {"turquoise2", "4ee2ec"},      {"darkorange", "f88017" },      {"dodgerblue", "1589ff" },      {"deepskyblue", "3bb9ff" },      {"darkslateblue", "2b3856" },      {"darkturquoise", "3b9c9c" },      {"blue", "0000ff" },      {"beige", "f5f3d7" },      {"bisque", "fde0bc" },      {"thistle", "d2b9d3"},      {"turquoise", "43c6db"},      {"orange1", "fa9b17"},      {"orchid1", "f67dfa"},      {"olivedrab1", "c3fb17"},      {"orange2", "e78e17"},      {"orchid2", "e473e7"},      {"olivedrab2", "b5e917"},      {"orangered2", "e43117"},      {"aquamarine1", "87fdce" },      {"antiquewhite1", "feedd6" },      {"cyan1", "57feff" },      {"cadetblue1", "99f3ff" },      {"orange", "f87a17"},      {"oldlace", "fcf3e2"},      {"azure2", "deecec" },      {"aquamarine2", "7deabe" },      {"antiquewhite2", "ebdbc5" },      {"cyan2", "50ebec" },      {"coral2", "e55b3c" },      {"cornsilk2", "ece5c6" },      {"cadetblue2", "8ee2ec" },      {"chartreuse2", "7fe817" },      {"azure", "efffff" },      {"aliceblue", "eff7ff" },      {"aquamarine", "43b7ba" },      {"antiquewhite", "9e8d2 "},      {"cadetblue", "578693" },      {"chocolate", "c85a17" },      {"chartreuse", "8afb17" },      {"cornflowerblue", "151b8d" }	};	static short lookup[] = {		-1,    -1,    -1,    -1,    -1,    -1,    -1,         -1,    -1,    -1,    -1,    -1,    -1,    -1,         -1,    -1,    -1,    -1,    -1,    -1,    -1,         -1,    -1,    -1,    -1,    -1,    -1,    -1,         -1,    -1,    -1,    -1,    -1,    -1,    -1,         -1,    -1,    -1,    -1,    -1,    -1,     0,         -1,    -1,     1,     2,    -1,    -1,    -1,         -1,    -1,    -1,    -1,    -1,    -1,    -1,         -1,    -1,    -1,    -1,  -554,    -1,  -551,       -549,    10,  -545,  -467,    -2,    -1,    13,       -470,    -2,  -472,    -2,    14,  -475,    -3,         -1,    -1,    15,    -1,    -1,    -1,    -1,         -1,    -1,    -1,    -1,    16,    -1,    17,         18,    -1,    -1,    19,    20,    -1,    -1,         -1,    -1,    -1,    -1,    -1,    -1,    -1,         21,    -1,    -1,    -1,    -1,  -602,    -1,       -599,  -597,    29,  -595,  -448,    -2,  -451,         -2,  -453,    -2,    32,  -456,    -3,    33,         -1,    -1,  -608,  -444,    -2,    -1,    -1,         -1,    -1,    -1,    -1,    -1,    -1,    -1,         -1,    -1,    -1,    -1,    -1,    -1,    -1,         -1,    -1,    -1,    -1,    -1,    -1,    -1,         -1,    -1,    -1,    -1,    -1,    -1,    -1,         -1,    -1,    36,    -1,  -665,    39,  -663,       -655,    -1,    45,    -1,    46,    47,    -1,         48,  -436,    -3,  -660,    51,    52,  -429,         -2,    53,  -438,    -2,  -441,    -2,    -1,         -1,    -1,    -1,    -1,    54,    -1,    -1,         55,    -1,    -1,    -1,    -1,    -1,    -1,         -1,    -1,    -1,    -1,    56,    57,    58,         -1,    -1,    -1,    59,    -1,  -723,    62,       -706,  -702,    68,    69,    -1,    70,  -413,         -3,    -1,    71,  -415,    -2,    72,    73,         74,    -1,    75,  -718,    -1,    79,    80,         81,  -402,    -3,    -1,    82,    83,  -418,         -2,    -1,    -1,    -1,    -1,    -1,    -1,         -1,    -1,    -1,    -1,    -1,    84,    85,         86,  -742,    -1,    89,  -391,    -2,  -756,         -1,    92,    -1,    93,  -750,  -384,    -2,         -1,  -754,  -382,    -2,  -388,    -2,    98,         -1,    -1,    99,  -763,  -378,    -9,    -1,        109,   110,    -1,    -1,    -1,    -1,  -778,        119,    -1,   120,    -1,   121,  -367,    -8,         -1,    -1,    -1,   122,    -1,   123,  -787,       -354,    -2,  -790,  -352,    -2,  -833,    -1,       -831,    -1,   138,  -824,    -1,  -800,  -331,         -2,  -817,  -804,  -320,    -2,    -1,  -808,       -318,    -8,    -1,   168,  -813,  -309,    -8,         -1,   177,  -329,    -9,    -1,   178,    -1,        179,   180,  -339,    -8,   181,  -829,   189,       -296,    -7,  -342,    -2,  -350,    -8,    -1,         -1,    -1,   190,    -1,    -1,    -1,    -1,         -1,   191,    -1,   192,    -1,  -865,   196,        197,  -857,   200,    -1,   201,   202,   203,       -280,    -2,   204,   205,   206,   207,    -1,        208,  -285,    -3,    -1,    -1,   209,    -1,         -1,    -1,    -1,    -1,   210,   211,   212,         -1,    -1,    -1,   213,    -1,   214,    -1,         -1,    -1,    -1,    -1,    -1,    -1,    -1,         -1,    -1,    -1,    -1,   215,    -1,  -915,        219,   220,  -907,   223,    -1,   224,   225,        226,  -257,    -2,   227,    -1,   228,   229,        230,   231,  -262,    -3,    -1,    -1,    -1,         -1,  -927,    -1,   234,  -925,  -243,    -2,       -246,    -2,    -1,    -1,    -1,    -1,    -1,         -1,    -1,   237,    -1,    -1,    -1,    -1,         -1,    -1,    -1,   238,    -1,    -1,  -948,       -239,    -2,    -1,    -1,    -1,   241,   242,         -1,   243,   244,   245,   246,    -1,   247,         -1,    -1,   248,   249,    -1,   250,   251,        252,   253,  -985,  -980,    -1,  -975,  -220,         -2,  -978,  -218,    -2,  -222,    -2,   262,         -1,   263,  -224,    -2,   264,   265,   266,         -1,    -1,    -1,    -1,   267,    -1,    -1,         -1,   268, -1000,  -209,    -2,    -1, -1051,        274, -1045, -1038,   279, -1016,   282,    -1,        283,   284,    -1,   285,   286,  -198,    -2,        287,   288,   289,   290,   291,    -1,   292,        293,   294,    -1,   295,   296,    -1,   297,        298, -1036,   301,   302,  -179,    -2,  -201,         -2, -1043,    -1,   305,  -175,    -2,  -203,         -2,    -1,   306,    -1,   307,  -207,    -3,         -1,    -1,    -1,    -1,    -1,    -1,    -1,         -1,    -1,    -1,    -1,    -1,   308,   309,         -1,   310,    -1,   311, -1072,  -166,    -2,         -1,    -1,    -1, -1085,   316,   317, -1083,         -1,   321,  -160,    -3,  -164,    -2,    -1,         -1,    -1, -1123,    -1,   324,   325,   326,        327, -1104,    -1,   330, -1101,   333,  -147,         -2,   334,  -150,    -2,   335,    -1, -1118,        338, -1116, -1114,    -1,   344,  -137,    -3,       -139,    -2,  -142,    -2,   345,    -1,   346,       -156,    -2,    -1,   347,    -1,    -1,    -1,         -1,    -1,    -1,    -1,   348,    -1, -1139,        351,   352,  -129,    -2,    -1,    -1,    -1,         -1,    -1,    -1,    -1,    -1,    -1,   353,        354,   355,    -1,    -1,    -1,    -1,    -1,         -1,    -1,    -1,    -1,    -1,    -1,    -1,         -1,   356,    -1,    -1,    -1,    -1,    -1,      -1173,  -121,    -2,   359,    -1,   360,    -1,        361,   362,    -1,   363,    -1,    -1,   364,        365,    -1,   366,    -1,    -1,    -1,    -1,         -1,   367, -1206,    -1,   377,    -1,   378,         -1,   379,   380, -1204,   -97,    -2,  -110,         -9, -1211,    -1,   385,   -95,    -2, -1215,        388,   -92,    -2, -1218,   -89,    -2,    -1,         -1,    -1,    -1,    -1,   391, -1231,    -1,        400,    -1,   401,   -86,    -8,    -1,    -1,        402,    -1,    -1,    -1,   403,    -1,    -1,        404,    -1,    -1,    -1,    -1,    -1,    -1,         -1,    -1,    -1,    -1,    -1,    -1,    -1,        405,    -1,   406,    -1,    -1,   407,    -1,         -1,    -1,    -1,    -1,    -1,    -1,    -1,         -1,    -1,    -1,   408,    -1,   409,    -1,         -1,    -1,    -1,    -1, -1293,    -1,   412,      -1289,   415,    -1,   416,   417,   -65,    -2,        418,   419,   -68,    -2,   420,    -1,   421,         -1,    -1,    -1,    -1,    -1,    -1,    -1,         -1,    -1,    -1,    -1,    -1,   422,    -1,      -1331,   426,   427, -1329,   430,    -1,   431,        432,   433,    -1,   434,   435,    -1,   436,        437,    -1,   438,   -50,    -2,   -55,    -3,         -1,    -1,    -1,    -1, -1346,   441,    -1,      -1341,   -36,    -2,   444,   445,   446,   -39,         -2,    -1,    -1,    -1,   447,    -1,   448,      -1355,   -29,    -2,   451,    -1,    -1,    -1,         -1,    -1,    -1,    -1,    -1,    -1,    -1,         -1,    -1,    -1,    -1,    -1,    -1,    -1,         -1,    -1,    -1,    -1,    -1,    -1,    -1,         -1,    -1,    -1, -1386,   -26,    -2, -1389,        -24,    -2,    -1,   456,    -1,   457,    -1,         -1,   458,    -1,    -1,    -1,    -1,   459,         -1,    -1,    -1,    -1,    -1,    -1,    -1,        460,   461,    -1,    -1,    -1,    -1,    -1,         -1,   462,    -1,    -1,    -1,    -1,   463,         -1,   464,    -1,    -1,   465,   466,    -1,         -1,   467,   468,   469,    -1,    -1,    -1,         -1,    -1,    -1,    -1,    -1,   470,    -1,         -1,    -1,   471,   472,    -1,   473,    -1,         -1,    -1,    -1,    -1,    -1,    -1, -1460,        476,    -4,    -2,    -1,   477	};	if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) {		register int key = color_hash(str, len);		if (key <= MAX_HASH_VALUE && key >= 0) {			register int index = lookup[key];			if (index >= 0) {				register const char *s = wordlist[index].name;				if (my_strcmp(str, s) == 0)					return &wordlist[index];			} else if (index < -TOTAL_KEYWORDS) {				register int offset = -1 - TOTAL_KEYWORDS - index;				register struct colors_t *wordptr = &wordlist[TOTAL_KEYWORDS + lookup[offset]];				register struct colors_t *wordendptr = wordptr + -lookup[offset + 1];				while (wordptr < wordendptr) {					register const char *s = wordptr->name;					if (my_strcmp(str, s) == 0)						return wordptr;					wordptr++;				}			}		}	}	return NULL;}/* * get_hex_value() - returns the hex value for  * a color name (ie: azure2 = deecec)  */char *color_get_hex_value(const char *rgb){	struct colors_t *colors;	char *lower;	if (!rgb)		return NULL;	lower = str_to_lower(rgb);	if(!lower)		return NULL;	colors = color_lookup(lower, strlen(lower));	free(lower);	if (!colors)		return NULL;	return strdup(colors->hex);}/* * hex_string_to_int() - converts a hex value (in a string) * to an integer */__inline int hex_string_to_int(char *hex){	int result;	sscanf(hex, "%x", &result);	return result;}gint32 get_color_value(const char *color){	char *hex;	gint32 result;	if(!color)		return -1;	hex = *color == '#' ? strdup(++color) : color_get_hex_value(color);		if(!hex) 		return 0;	result = strtol(hex, NULL, 16);	free(hex);	return result;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -