aboutsummaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
Diffstat (limited to 'st.c')
-rw-r--r--st.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/st.c b/st.c
index ab8540c..5ed3753 100644
--- a/st.c
+++ b/st.c
@@ -1915,17 +1915,12 @@ xloadcols(void) {
1915 int i, r, g, b; 1915 int i, r, g, b;
1916 XRenderColor xft_color = { .alpha = 0 }; 1916 XRenderColor xft_color = { .alpha = 0 };
1917 1917
1918 /* load default white color */
1919 if(!XftColorAllocName(xw.dpy, xw.vis, xw.cmap, colorname[256], &dc.xft_col[256]))
1920 die("Could not allocate color '%s'\n", colorname[256]);
1921
1922 /* load colors [0-15] colors and [256-LEN(colorname)[ (config.h) */ 1918 /* load colors [0-15] colors and [256-LEN(colorname)[ (config.h) */
1923 for(i = 0; i < LEN(colorname); i++) { 1919 for(i = 0; i < LEN(colorname); i++) {
1924 if(!colorname[i]) 1920 if(!colorname[i])
1925 continue; 1921 continue;
1926 if(!XftColorAllocName(xw.dpy, xw.vis, xw.cmap, colorname[i], &dc.xft_col[i])) { 1922 if(!XftColorAllocName(xw.dpy, xw.vis, xw.cmap, colorname[i], &dc.xft_col[i])) {
1927 dc.xft_col[i] = dc.xft_col[256]; 1923 die("Could not allocate color '%s'\n", colorname[i]);
1928 fprintf(stderr, "Could not allocate color '%s'\n", colorname[i]);
1929 } 1924 }
1930 } 1925 }
1931 1926
@@ -1937,8 +1932,7 @@ xloadcols(void) {
1937 xft_color.green = g == 0 ? 0 : 0x3737 + 0x2828 * g; 1932 xft_color.green = g == 0 ? 0 : 0x3737 + 0x2828 * g;
1938 xft_color.blue = b == 0 ? 0 : 0x3737 + 0x2828 * b; 1933 xft_color.blue = b == 0 ? 0 : 0x3737 + 0x2828 * b;
1939 if(!XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &xft_color, &dc.xft_col[i])) { 1934 if(!XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &xft_color, &dc.xft_col[i])) {
1940 dc.xft_col[i] = dc.xft_col[256]; 1935 die("Could not allocate color %d\n", i);
1941 fprintf(stderr, "Could not allocate color %d\n", i);
1942 } 1936 }
1943 i++; 1937 i++;
1944 } 1938 }