snipplets.dev/~/C/rgbToHex.c

13 lines
195 B
C
Raw Normal View History

2023-04-14 23:04:16 +03:00
#include <stdio.h>
int main(int argc, char const *argv[])
{
int red = 0;
int green = 128;
int blue = 64;
2023-06-03 23:41:22 +03:00
printf("#%.2x%.2x%.2x\n", red, green, blue); //#008040
2023-04-14 23:04:16 +03:00
return 0;
}