diff --git a/apps/menu.c b/apps/menu.c index 933f9ba5..e95703c2 100644 --- a/apps/menu.c +++ b/apps/menu.c @@ -59,14 +59,6 @@ struct ListEntry_Separator { struct ListEntry; }; -static uint32_t interp_colors(uint32_t bottom, uint32_t top, uint8_t interp) { - uint8_t red = (_RED(bottom) * (255 - interp) + _RED(top) * interp) / 255; - uint8_t gre = (_GRE(bottom) * (255 - interp) + _GRE(top) * interp) / 255; - uint8_t blu = (_BLU(bottom) * (255 - interp) + _BLU(top) * interp) / 255; - uint8_t alp = (_ALP(bottom) * (255 - interp) + _ALP(top) * interp) / 255; - return rgba(red,gre,blu, alp); -} - #define HILIGHT_BORDER_TOP rgb(54,128,205) #define HILIGHT_GRADIENT_TOP rgb(93,163,236) #define HILIGHT_GRADIENT_BOTTOM rgb(56,137,220) diff --git a/apps/panel.c b/apps/panel.c index a6a11322..2011e0ea 100644 --- a/apps/panel.c +++ b/apps/panel.c @@ -637,14 +637,6 @@ static void read_applications(FILE * f) { fclose(f); } -static uint32_t interp_colors(uint32_t bottom, uint32_t top, uint8_t interp) { - uint8_t red = (_RED(bottom) * (255 - interp) + _RED(top) * interp) / 255; - uint8_t gre = (_GRE(bottom) * (255 - interp) + _GRE(top) * interp) / 255; - uint8_t blu = (_BLU(bottom) * (255 - interp) + _BLU(top) * interp) / 255; - uint8_t alp = (_ALP(bottom) * (255 - interp) + _ALP(top) * interp) / 255; - return rgba(red,gre,blu, alp); -} - #define HILIGHT_BORDER_TOP rgb(54,128,205) #define HILIGHT_GRADIENT_TOP rgb(93,163,236) #define HILIGHT_GRADIENT_BOTTOM rgb(56,137,220) diff --git a/base/usr/include/toaru/graphics.h b/base/usr/include/toaru/graphics.h index 980422bd..b75f901a 100644 --- a/base/usr/include/toaru/graphics.h +++ b/base/usr/include/toaru/graphics.h @@ -90,3 +90,4 @@ extern void gfx_clear_clip(gfx_context_t * ctx); extern uint32_t getBilinearFilteredPixelColor(sprite_t * tex, double u, double v); +extern uint32_t interp_colors(uint32_t bottom, uint32_t top, uint8_t interp); diff --git a/lib/graphics.c b/lib/graphics.c index a38b3345..7ab359f6 100644 --- a/lib/graphics.c +++ b/lib/graphics.c @@ -718,3 +718,11 @@ void draw_sprite_scaled_alpha(gfx_context_t * ctx, sprite_t * sprite, int32_t x, } } + +uint32_t interp_colors(uint32_t bottom, uint32_t top, uint8_t interp) { + uint8_t red = (_RED(bottom) * (255 - interp) + _RED(top) * interp) / 255; + uint8_t gre = (_GRE(bottom) * (255 - interp) + _GRE(top) * interp) / 255; + uint8_t blu = (_BLU(bottom) * (255 - interp) + _BLU(top) * interp) / 255; + uint8_t alp = (_ALP(bottom) * (255 - interp) + _ALP(top) * interp) / 255; + return rgba(red,gre,blu, alp); +}