mirror of
https://gitlab.com/mfocko/CodeWars.git
synced 2024-11-22 08:33:48 +01:00
13 lines
211 B
C
13 lines
211 B
C
#include <stdio.h>
|
|
|
|
typedef struct {
|
|
int r, g, b;
|
|
} rgb;
|
|
|
|
rgb hex_str_to_rgb(const char *hex_str) {
|
|
rgb result;
|
|
|
|
sscanf(hex_str, "#%2x%2x%2x", &result.r, &result.g, &result.b);
|
|
|
|
return result;
|
|
}
|