skip color hexa when parsing

This commit is contained in:
hugogogo
2021-07-25 13:28:43 +02:00
parent c06489fd99
commit 9cfb43e7da
7 changed files with 13 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
fdf

Binary file not shown.

View File

@@ -37,6 +37,18 @@ int **split_to_map(t_fdf *fdf, char *raw)
return (map);
}
int is_color(char *color)
{
int i;
i = 0;
if (!ft_strncmp(color, ",0x", 3))
i += 3;
while (ft_isalnum(color[i]))
i++;
return (i);
}
int size_width(char *raw)
{
int i;
@@ -51,6 +63,7 @@ int size_width(char *raw)
i++;
while (ft_isdigit(raw[i]))
i++;
i += is_color(raw + i);
j++;
}
return (j);