Rev 7752 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7752 | Rev 8016 | ||
---|---|---|---|
Line 4... | Line 4... | ||
4 | struct color_spec { |
4 | struct color_spec { |
5 | char *name; |
5 | char *name; |
6 | int rgb; |
6 | int rgb; |
7 | }; |
7 | }; |
Line 8... | Line 8... | ||
8 | 8 | ||
9 | dword text_colors[300]; |
- | |
Line 10... | Line 9... | ||
10 | dword text_color_index; |
9 | collection_int text_colors; |
11 | 10 | ||
12 | struct color_spec color_specs[] = { |
11 | struct color_spec color_specs[] = { |
13 | "aliceblue", 0xF0F8FF, |
12 | "aliceblue", 0xF0F8FF, |
Line 157... | Line 156... | ||
157 | dword j=1, |
156 | dword j=1, |
158 | color=0, |
157 | color=0, |
159 | textlen=0; |
158 | textlen=0; |
160 | char ch=0x00; |
159 | char ch=0x00; |
Line 161... | Line 160... | ||
161 | 160 | ||
Line 162... | Line 161... | ||
162 | if (ESBYTE[htmlcolor]<>'#') return text_colors[0]; |
161 | if (ESBYTE[htmlcolor]<>'#') return text_colors.get(0); |
Line 163... | Line 162... | ||
163 | 162 | ||
164 | textlen = strlen(htmlcolor); |
163 | textlen = strlen(htmlcolor); |
Line 175... | Line 174... | ||
175 | if (textlen==4) color = color*0x10 + ch; //#abc ->> #aabbcc (ñëàâà âèêèïåäèè!!1) |
174 | if (textlen==4) color = color*0x10 + ch; //#abc ->> #aabbcc (ñëàâà âèêèïåäèè!!1) |
176 | } |
175 | } |
177 | return color; |
176 | return color; |
178 | } |
177 | } |
Line 179... | Line 178... | ||
179 | 178 | ||
180 | return text_colors[0]; |
179 | return text_colors.get(0); |
Line 181... | Line 180... | ||
181 | } |
180 | } |
182 | 181 | ||
183 | dword GetColor(char* color_str) |
182 | dword GetColor(char* color_str) |
Line 190... | Line 189... | ||
190 | for (ii=0; color_specs[ii].name!=0; ii++) |
189 | for (ii=0; color_specs[ii].name!=0; ii++) |
191 | { |
190 | { |
192 | if (!strcmpi(color_str, color_specs[ii].name)) return color_specs[ii].rgb; |
191 | if (!strcmpi(color_str, color_specs[ii].name)) return color_specs[ii].rgb; |
193 | } |
192 | } |
Line 194... | Line 193... | ||
194 | 193 | ||
195 | return text_colors[0]; |
194 | return text_colors.get(0); |