diff --git a/include/gds-render/layer/layer-selector.h b/include/gds-render/layer/layer-selector.h index 011eca1..240982d 100644 --- a/include/gds-render/layer/layer-selector.h +++ b/include/gds-render/layer/layer-selector.h @@ -33,6 +33,7 @@ #include #include +#include G_BEGIN_DECLS @@ -90,6 +91,14 @@ GList *layer_selector_export_rendered_layer_info(LayerSelector *selector); */ void layer_selector_force_sort(LayerSelector *selector, enum layer_selector_sort_algo sort_function); +/** + * @brief Apply colors from palette to all layers. Aditionally set alpha + * @param layer_selector LayerSelector object + * @param palette Color palette to use + * @param global_alpha Additional alpha value that is applied to all layers + */ +void layer_selector_auto_color_layers(LayerSelector *layer_selector, ColorPalette *palette, double global_alpha); + G_END_DECLS #endif /* __LAYER_SELECTOR_H__ */ diff --git a/layer/layer-selector.c b/layer/layer-selector.c index acf216c..a9c68e1 100644 --- a/layer/layer-selector.c +++ b/layer/layer-selector.c @@ -781,4 +781,14 @@ void layer_selector_force_sort(LayerSelector *selector, enum layer_selector_sort gtk_list_box_set_sort_func(box, NULL, NULL, NULL); } +void layer_selector_auto_color_layers(LayerSelector *layer_selector, ColorPalette *palette, double global_alpha) +{ + if (GDS_RENDER_IS_COLOR_PALETTE(palette) == FALSE || LAYER_IS_SELECTOR(layer_selector) == FALSE) + return; + if (global_alpha <= 0) + return; + + +} + /** @} */