examples/color.c
raw| 1 | #include <stdint.h> |
| 2 | #include <string.h> |
| 3 | |
| 4 | typedef struct color_t { |
| 5 | char name[8]; |
| 6 | uint8_t red; |
| 7 | uint8_t green; |
| 8 | uint8_t blue; |
| 9 | } color_t; |
| 10 | |
| 11 | color_t |
| 12 | color_increase_red(color_t color, uint8_t amount) |
| 13 | { |
| 14 | strcpy(color.name, "reddish"); |
| 15 | color.red += amount; |
| 16 | return color; |
| 17 | } |