aboutsummaryrefslogtreecommitdiffstats
path: root/src/yawa.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/yawa.c')
-rw-r--r--src/yawa.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/yawa.c b/src/yawa.c
index 453421a..9a78eea 100644
--- a/src/yawa.c
+++ b/src/yawa.c
@@ -46,6 +46,13 @@ parse_opt(signed key, char *arg, struct argp_state *state)
num_add_colors += 1;
break;
+ case 'D':
+ ;
+ signed distance = parse_int(arg, "add distance");
+ arguments->distance[num_distances] = distance;
+ num_distances += 1;
+ break;
+
case 'g':
arguments->gradient = true;
arguments->angle = parse_int(arg, "gradient angle");
@@ -274,13 +281,17 @@ signed
main(signed argc, char **argv)
{
struct arguments arguments = {
- "", "", {{0}}, "", "", 0, 0, 0, 0, 0, 0, 0,
+ "", "", {{0}}, {0}, "", "", 0, 0, 0, 0, 0, 0, 0,
false, false, false, false, false, false,
false, false, false, false, false, false,
false, false, false, false, false, false,
false,
};
+ for(unsigned long i = 0; i < (sizeof arguments.distance)/(sizeof (signed)); i++) {
+ arguments.distance[i] = 1;
+ }
+
// Where the magic happens
argp_parse(&argp, argc, argv, 0, 0, &arguments);
@@ -353,7 +364,6 @@ main(signed argc, char **argv)
imlib_free_color_range();
imlib_context_set_color_range(imlib_create_color_range());
}
- // TODO: Add back -addd
if (arguments.add) {
for (i = 0; i < num_add_colors; i++) {
Color c;
@@ -362,7 +372,7 @@ main(signed argc, char **argv)
exit(-2);
}
imlib_context_set_color(c.r, c.g, c.b, c.a);
- imlib_add_color_to_color_range(1);
+ imlib_add_color_to_color_range(arguments.distance[i]);
}
}
if (arguments.gradient) {