snipplets.dev/code/C/Transform/rgbToHex.c

12 lines
186 B
C
Raw Normal View History

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