tweaks: rename three parameters, away from single letters
Also, reshuffle two lines, to have the code after the declaration.master
parent
58cba6a7c6
commit
1c6f6ba212
10
src/rcfile.c
10
src/rcfile.c
|
@ -992,15 +992,15 @@ void parse_includes(char *ptr)
|
||||||
|
|
||||||
/* Return the index of the color that is closest to the given RGB levels,
|
/* Return the index of the color that is closest to the given RGB levels,
|
||||||
* assuming that the terminal uses the 6x6x6 color cube of xterm-256color. */
|
* assuming that the terminal uses the 6x6x6 color cube of xterm-256color. */
|
||||||
short closest_index_color(short r, short g, short b)
|
short closest_index_color(short red, short green, short blue)
|
||||||
{
|
{
|
||||||
if (COLORS != 256)
|
|
||||||
return THE_DEFAULT;
|
|
||||||
|
|
||||||
/* Translation table, from 16 intended levels to 6 available levels. */
|
/* Translation table, from 16 intended levels to 6 available levels. */
|
||||||
static const short level[] = { 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5 };
|
static const short level[] = { 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5 };
|
||||||
|
|
||||||
return (36 * level[r] + 6 * level[g] + level[b] + 16);
|
if (COLORS == 256)
|
||||||
|
return (36 * level[red] + 6 * level[green] + level[blue] + 16);
|
||||||
|
else
|
||||||
|
return THE_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define COLORCOUNT 20
|
#define COLORCOUNT 20
|
||||||
|
|
Loading…
Reference in New Issue