Skip to content

Commit 002b84b

Browse files
boredlandbretello
andauthored
use #rgba instead of #argb for colors definition (#79)
fixes #70 Co-authored-by: bretello <[email protected]>
1 parent 73491a1 commit 002b84b

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

main.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#define STR(x) #x
1717

1818
// sizeof already includes NULL byte
19-
#define INPUT_BUFFER_LENGTH (3 * sizeof(unsigned long) + sizeof(" #FF000000 #FFFFFFFF #FFFFFFFF\n"))
19+
#define INPUT_BUFFER_LENGTH (3 * sizeof(unsigned long) + sizeof(" #000000FF #FFFFFFFF #FFFFFFFF\n"))
2020

2121
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
2222

@@ -511,13 +511,13 @@ main(int argc, char **argv)
511511
" -M, --margin <px> Define anchor margin in pixels, defaults to " STR(WOB_DEFAULT_MARGIN) ". \n"
512512
" -O, --output <name> Define output to show bar on or '*' for all. If ommited, focused output is chosen.\n"
513513
" May be specified multiple times.\n"
514-
" --border-color <#argb> Define border color\n"
515-
" --background-color <#argb> Define background color\n"
516-
" --bar-color <#argb> Define bar color\n"
514+
" --border-color <#rgba> Define border color\n"
515+
" --background-color <#rgba> Define background color\n"
516+
" --bar-color <#rgba> Define bar color\n"
517517
" --overflow-mode <mode> Change the overflow behavior. Valid options are `none`, `wrap` (default), and `nowrap`.\n"
518-
" --overflow-bar-color <#argb> Define bar color when overflowed\n"
519-
" --overflow-border-color <#argb> Define the border color when overflowed\n"
520-
" --overflow-background-color <#argb> Define the background color when overflowed\n"
518+
" --overflow-bar-color <#rgba> Define bar color when overflowed\n"
519+
" --overflow-border-color <#rgba> Define the border color when overflowed\n"
520+
" --overflow-background-color <#rgba> Define the background color when overflowed\n"
521521
"\n";
522522

523523
struct wob app = {0};

parse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ wob_parse_color(const char *restrict str, char **restrict str_end, struct wob_co
2727
}
2828

2929
*color = (struct wob_color){
30-
.a = (float) parts[0] / UINT8_MAX,
3130
.r = (float) parts[1] / UINT8_MAX,
3231
.g = (float) parts[2] / UINT8_MAX,
3332
.b = (float) parts[3] / UINT8_MAX,
33+
.a = (float) parts[0] / UINT8_MAX,
3434
};
3535

3636
if (str_end) {

tests/wob_parse_input.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ main(int argc, char **argv)
2222
}
2323

2424
printf("running 2\n");
25-
input = "25 #FF000000\n";
25+
input = "25 #000000FF\n";
2626
result = wob_parse_input(input, &percentage, &background, &border, &bar);
2727
if (result) {
2828
return EXIT_FAILURE;

wob.1.scd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ wob is a lightweight overlay volume/backlight/progress/anything bar for Wayland.
5555
Define output to show bar on or '\*' for all. If ommited, focused output is chosen.
5656
May be specified multiple times.
5757

58-
*--border-color* <#AARRGGBB>
58+
*--border-color* <#RRGGBBAA>
5959
Define border color, defaults to #FFFFFFFF.
6060

61-
*--background-color* <#AARRGGBB>
62-
Define background color, defaults to #FF000000.
61+
*--background-color* <#RRGGBBAA>
62+
Define background color, defaults to #000000FF.
6363

64-
*--bar-color* <#AARRGGBB>
64+
*--bar-color* <#RRGGBBAA>
6565
Define bar color, defaults to #FFFFFFFF.
6666

6767
*--overflow-mode <mode>*
@@ -86,7 +86,7 @@ or
8686

8787
<value> <#background_color> <#border_color> <#bar_color>
8888

89-
Where <value> is number in interval from 0 to *--max* and <#\*color> is color in #AARRGGBB format.
89+
Where <value> is number in interval from 0 to *--max* and <#\*color> is color in #RRGGBBAA format.
9090

9191
# ENVIRONMENT
9292

0 commit comments

Comments
 (0)