tcp_cmd
0 is alpha ff is opaque
This commit is contained in:
@@ -57,7 +57,6 @@ static char* shift_args(int* argc, char*** argv) {
|
||||
static bool str_to_color(int argc, char** argv, uint32_t* color) {
|
||||
if (argc == 1) {
|
||||
*color = (uint32_t)strtoul(argv[0], NULL, 16);
|
||||
*color ^= 0xff000000;
|
||||
return false;
|
||||
}
|
||||
if (argc == 3) {
|
||||
@@ -68,8 +67,7 @@ static bool str_to_color(int argc, char** argv, uint32_t* color) {
|
||||
return false;
|
||||
}
|
||||
if (argc == 4) {
|
||||
*color = 0xff000000;
|
||||
*color ^= (uint32_t)strtoul(argv[0], NULL, 10) << 24;
|
||||
*color = (uint32_t)strtoul(argv[0], NULL, 10) << 24;
|
||||
*color |= (uint32_t)strtoul(argv[1], NULL, 10) << 16;
|
||||
*color |= (uint32_t)strtoul(argv[2], NULL, 10) << 8;
|
||||
*color |= (uint32_t)strtoul(argv[3], NULL, 10);
|
||||
|
||||
Reference in New Issue
Block a user