diff --git a/src/lgfx/v1/LGFXBase.hpp b/src/lgfx/v1/LGFXBase.hpp index 6a35d498..80d66187 100644 --- a/src/lgfx/v1/LGFXBase.hpp +++ b/src/lgfx/v1/LGFXBase.hpp @@ -270,9 +270,9 @@ namespace lgfx const colors_t createGradient( const rgb888_t(&colors)[N] ) { const colors_t ret = { colors, N }; return ret; } const colors_t createGradient( const rgb888_t* colors, const uint32_t count ) { const colors_t ret = { colors, count }; return ret; } template - T mapGradient( double val, double min, double max, const colors_t gr ) { rgb888_t c=map_gradient(val, min, max, gr); return T(c.r, c.g, c.b); } + T mapGradient( float val, float min, float max, const colors_t gr ) { rgb888_t c=map_gradient(val, min, max, gr); return T(c.r, c.g, c.b); } template - T mapGradient( double val, double min, double max, const rgb888_t *colors, uint32_t count ) { rgb888_t c=map_gradient(val, min, max, colors, count); return T(c.r, c.g, c.b); } + T mapGradient( float val, float min, double max, const rgb888_t *colors, uint32_t count ) { rgb888_t c=map_gradient(val, min, max, colors, count); return T(c.r, c.g, c.b); } LGFX_INLINE_T void drawSmoothLine ( int32_t x0, int32_t y0, int32_t x1, int32_t y1, const T& color ) { drawWideLine( x0, y0, x1, y1, 0.5f, color); } void drawGradientLine ( int32_t x0, int32_t y0, int32_t x1, int32_t y1, const colors_t colors ) { draw_gradient_line(x0, y0, x1, y1, colors); } @@ -1293,8 +1293,8 @@ namespace lgfx bool clampArea(int32_t *xlo, int32_t *ylo, int32_t *xhi, int32_t *yhi); - rgb888_t map_gradient( double value, double start, double end, const rgb888_t *colors, uint32_t colors_count ); - rgb888_t map_gradient( double value, double start, double end, const colors_t gradient ); + rgb888_t map_gradient( float value, float start, float end, const rgb888_t *colors, uint32_t colors_count ); + rgb888_t map_gradient( float value, float start, float end, const colors_t gradient ); void draw_gradient_line( int32_t x0, int32_t y0, int32_t x1, int32_t y1, uint32_t colorstart, uint32_t colorend ); void draw_gradient_line( int32_t x0, int32_t y0, int32_t x1, int32_t y1, const colors_t gradient );