Files
HaxSam 2319475dd0 VGM/RPC: Rework custom colors, smoother config, better rainbow support (#53)
* first poc works

* rainbow mode now works over rpc

still not done refrash rate from flipper change and is slow so the rainbow mode doesnt look good

* transmit VgmMode

* use all the 32bit

* some config stuff

* sync apps

* Change protobuf repo

* Some lib naming changes and cleanup

* Format protobuf

* Update from RGB backlight if enabled

* Remove old expansion toggling

* Update settings UI

* Fix searching previous value

* VGM Tool: Add new RGB firmware

* Update changelog

* These are unused

---------

Co-authored-by: Willy-JL <49810075+Willy-JL@users.noreply.github.com>
2024-06-02 08:41:47 +01:00

40 lines
770 B
C

#pragma once
#include <stdint.h>
#include <string.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef union __attribute__((packed)) {
struct {
uint8_t r;
uint8_t g;
uint8_t b;
};
uint32_t value : 24;
} RgbColor;
typedef union __attribute__((packed)) {
struct {
uint8_t h;
uint8_t s;
uint8_t v;
};
uint32_t value : 24;
} HsvColor;
_Static_assert(sizeof(RgbColor) == 3, "RGB color must be 24-bit");
_Static_assert(sizeof(HsvColor) == 3, "HSV color must be 24-bit");
int rgbcmp(const RgbColor* a, const RgbColor* b);
int hsvcmp(const HsvColor* a, const HsvColor* b);
void hsv2rgb(const HsvColor* hsv, RgbColor* rgb);
void rgb2hsv(const RgbColor* rgb, HsvColor* hsv);
#ifdef __cplusplus
}
#endif