diff options
Diffstat (limited to 'x.c')
| -rw-r--r-- | x.c | 13 |
1 files changed, 13 insertions, 0 deletions
| @@ -800,6 +800,19 @@ xloadcols(void) | |||
| 800 | } | 800 | } |
| 801 | 801 | ||
| 802 | int | 802 | int |
| 803 | xgetcolor(int x, unsigned char *r, unsigned char *g, unsigned char *b) | ||
| 804 | { | ||
| 805 | if (!BETWEEN(x, 0, dc.collen)) | ||
| 806 | return 1; | ||
| 807 | |||
| 808 | *r = dc.col[x].color.red >> 8; | ||
| 809 | *g = dc.col[x].color.green >> 8; | ||
| 810 | *b = dc.col[x].color.blue >> 8; | ||
| 811 | |||
| 812 | return 0; | ||
| 813 | } | ||
| 814 | |||
| 815 | int | ||
| 803 | xsetcolorname(int x, const char *name) | 816 | xsetcolorname(int x, const char *name) |
| 804 | { | 817 | { |
| 805 | Color ncolor; | 818 | Color ncolor; |
