NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
color.h
Go to the documentation of this file.
1 /*
2  * This file is part of Ninjaflight.
3  *
4  * Ninjaflight is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * Ninjaflight is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Ninjaflight. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #pragma once
19 
20 typedef enum {
21  RGB_RED = 0,
25 
26 #define RGB_COLOR_COMPONENT_COUNT (RGB_BLUE + 1)
27 
28 typedef union {
29  struct {
30  uint8_t r;
31  uint8_t g;
32  uint8_t b;
33  } rgb;
36 
37 #define HSV_HUE_MAX 359
38 #define HSV_SATURATION_MAX 255
39 #define HSV_VALUE_MAX 255
40 
41 typedef enum {
42  HSV_HUE = 0,
46 
47 #define HSV_COLOR_COMPONENT_COUNT (HSV_VALUE + 1)
48 
49 typedef struct hsvColor_s {
50  uint16_t h; // 0 - 359
51  uint8_t s; // 0 - 255
52  uint8_t v; // 0 - 255
53 } hsvColor_t;
#define RGB_COLOR_COMPONENT_COUNT
Definition: color.h:26
struct hsvColor_s hsvColor_t
uint16_t h
Definition: color.h:50
Definition: color.h:21
uint8_t s
Definition: color.h:51
Definition: color.h:28
Definition: color.h:44
colorComponent_e
Definition: color.h:20
Definition: color.h:42
Definition: color.h:43
uint8_t v
Definition: color.h:52
Definition: color.h:23
uint8_t b
Definition: color.h:32
Definition: color.h:22
uint8_t r
Definition: color.h:30
uint8_t g
Definition: color.h:31
int16_t raw[2]
Definition: accelerometer.h:51
Definition: color.h:49
hsvColorComponent_e
Definition: color.h:41