blob: 4863c77aca181f6384a7abeed1c83de81d741364 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#include<stdio.h>
int main( int argc, char *argv[] ) {
if ( argc != 5 ) {
printf("Usage %s <red> <green> <blue> <alpha>\n", argv[0]);
return 1;
}
unsigned char red = atoi( argv[1] );
unsigned char green = atoi( argv[2] );
unsigned char blue = atoi( argv[3] );
unsigned char alpha = atoi( argv[4] );
unsigned int colour = alpha << 24 | red << 16 | green << 8 | blue;
printf("R: %u G: %u B: %u A: %u\nColour value: %u\n", red , green, blue, alpha, colour);
}
|