And a method for printing the colorscheme.
This commit is contained in:
parent
447600497e
commit
bf70ebefbf
2 changed files with 10 additions and 4 deletions
8
config.h
8
config.h
|
|
@ -88,7 +88,13 @@ static const int alpha = 0xdd;
|
||||||
|
|
||||||
static int whichcolortable = 0;
|
static int whichcolortable = 0;
|
||||||
|
|
||||||
static char *colornames[3][260] = {
|
static const char *schemenames[] = {
|
||||||
|
"Cobalt Neon",
|
||||||
|
"Highway",
|
||||||
|
"Grape",
|
||||||
|
};
|
||||||
|
|
||||||
|
static char *colorchart[3][260] = {
|
||||||
// cobalt neon
|
// cobalt neon
|
||||||
{
|
{
|
||||||
"#142631", // 0
|
"#142631", // 0
|
||||||
|
|
|
||||||
6
st.c
6
st.c
|
|
@ -3167,7 +3167,7 @@ sixd_to_16bit(int x)
|
||||||
|
|
||||||
const char* getcolorname(int i)
|
const char* getcolorname(int i)
|
||||||
{
|
{
|
||||||
return colornames[whichcolortable][i];
|
return colorchart[whichcolortable][i];
|
||||||
// return (usealtcolors) ? altcolorname[i] : colorname[i];
|
// return (usealtcolors) ? altcolorname[i] : colorname[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4040,7 +4040,7 @@ void xcolor2title(void){
|
||||||
|
|
||||||
lencs = (size_t)snprintf(NULL,0,"new color %d",whichcolortable);
|
lencs = (size_t)snprintf(NULL,0,"new color %d",whichcolortable);
|
||||||
cs = malloc(lencs);
|
cs = malloc(lencs);
|
||||||
snprintf(cs,lencs,"new color %d",whichcolortable);
|
sprintf(cs,"colorscheme %s",schemenames[whichcolortable]);
|
||||||
xsettitle(cs);
|
xsettitle(cs);
|
||||||
free(cs);
|
free(cs);
|
||||||
}
|
}
|
||||||
|
|
@ -4184,7 +4184,7 @@ swapcolors(const Arg *dummy)
|
||||||
{
|
{
|
||||||
usealtcolors = !usealtcolors;
|
usealtcolors = !usealtcolors;
|
||||||
whichcolortable = whichcolortable +1;
|
whichcolortable = whichcolortable +1;
|
||||||
if ( whichcolortable >= sizeof(colornames)/sizeof(colornames[0]) ) {
|
if ( whichcolortable >= sizeof(colorchart)/sizeof(colorchart[0]) ) {
|
||||||
whichcolortable = 0;
|
whichcolortable = 0;
|
||||||
}
|
}
|
||||||
xcolor2title();
|
xcolor2title();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue