Skip to content

Commit

Permalink
Merge pull request #61 from suve/use-hex-colours
Browse files Browse the repository at this point in the history
Use #hex format for colours
  • Loading branch information
theZiz committed Feb 9, 2019
2 parents f9faec5 1836019 commit 50b5135
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions aha.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 198,7 @@ void make_rgb (int color_id, char str_rgb[12]){
{
int index = color_id - 232;
int grey = index * 256 / 24;
sprintf(str_rgb, "%d,%d,%d", grey, grey, grey);
sprintf(str_rgb, "%02xxx", grey, grey, grey);
return;
}
int index_R = divide((color_id - 16), 36);
Expand All @@ -224,7 224,7 @@ void make_rgb (int color_id, char str_rgb[12]){
} else {
rgb_B = 0;
}
sprintf(str_rgb, "%d,%d,%d", rgb_R, rgb_G, rgb_B);
sprintf(str_rgb, "%02xxx", rgb_R, rgb_G, rgb_B);
}

#define VERSION_PRINTF_MAKRO \
Expand Down Expand Up @@ -938,11 938,11 @@ int main(int argc,char* args[])
{
char rgb[12];
make_rgb(state.fc,rgb);
printf("color: rgb(%s);",rgb);
printf("color:#%s;",rgb);
}
break;
case MODE_24BIT:
printf("color: #x;",state.fc);
printf("color:#x;",state.fc);
break;
};
if (opts.stylesheet &&
Expand All @@ -963,11 963,11 @@ int main(int argc,char* args[])
{
char rgb[12];
make_rgb(state.bc,rgb);
printf("background-color: rgb(%s);",rgb);
printf("background-color:#%s;",rgb);
}
break;
case MODE_24BIT:
printf("background-color: #x;",state.bc);
printf("background-color:#x;",state.bc);
break;
};
printf("\">");
Expand Down

0 comments on commit 50b5135

Please sign in to comment.