aboutsummaryrefslogtreecommitdiff
path: root/fbwarn/src/parseBVG.c
diff options
context:
space:
mode:
Diffstat (limited to 'fbwarn/src/parseBVG.c')
-rw-r--r--fbwarn/src/parseBVG.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/fbwarn/src/parseBVG.c b/fbwarn/src/parseBVG.c
index 235253b..ff8b248 100644
--- a/fbwarn/src/parseBVG.c
+++ b/fbwarn/src/parseBVG.c
@@ -32,16 +32,21 @@ void BVGRectangle(char *argv[5]) {
printf("Drawing rectangle\n");
argv[4][strlen(argv[4])-2] = '\0';
printf("%s, %s\n %s, %s,\n %s\n", argv[0], argv[1], argv[2], argv[3], argv[4]);
- int x, y, width, height, color;
+ int x, y, width, height, r, g, b;
sscanf(argv[0]+strlen("x="), "%d", &x);
sscanf(argv[1]+strlen("y="), "%d", &y);
sscanf(argv[2]+strlen("width="), "%d", &width);
sscanf(argv[3]+strlen("height="), "%d", &height);
- color = (int)strtol(argv[4]+strlen("color='#"), NULL, 16);
+ sscanf(argv[4]+strlen("color='#"), "%02x%02x%02x", &r, &g, &b);
printf("X: %d, Y: %d\n", x, y);
printf("Width: %d, Height: %d\n", width, height);
- printf("Color: %d\n", color);
- DrawRectangle(x, y, width, height, PINK);
+ printf("Color: %d, %d, %d\n", r, g, b);
+ Color *clr = malloc(sizeof(Color));
+ clr->r=r;
+ clr->g=g;
+ clr->b=b;
+ clr->a=255;
+ DrawRectangle(x, y, width, height, *clr);
return;
}