23 #include "lv_palette.h"
24 #include "lv_common.h"
28 VisPalette* visual_palette_new (
unsigned int ncolors)
45 visual_return_if_fail (
self !=
nullptr);
46 visual_return_if_fail (src !=
nullptr);
51 void visual_palette_allocate_colors (
VisPalette *
self,
int ncolors)
53 visual_return_if_fail (
self !=
nullptr);
55 self->allocate_colors (ncolors);
58 unsigned int visual_palette_get_size (
VisPalette *
self)
60 visual_return_val_if_fail (
self !=
nullptr, 0);
67 visual_return_val_if_fail (
self !=
nullptr,
nullptr);
68 visual_return_val_if_fail (self->size() > 0,
nullptr);
70 return self->colors.data ();
75 visual_return_val_if_fail (
self !=
nullptr,
nullptr);
76 visual_return_val_if_fail (self->size() > 0,
nullptr);
77 visual_return_val_if_fail (index < 0,
nullptr);
79 return &
self->colors[index];
84 visual_return_if_fail (
self !=
nullptr);
85 visual_return_if_fail (src1 !=
nullptr);
86 visual_return_if_fail (src2 !=
nullptr);
88 self->blend (*src1, *src2, rate);
93 visual_return_val_if_fail (
self !=
nullptr, -1);
95 return self->find_color (*color);