added thick lines and gradient fill support #528
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Features in this PR:
LGFX Methods:
NOTE: COLOR can be any of uint8_t, uint16_t, uint32_t, RGBColor, rgb888_t, rgb565_t, rgb888_t, etc
Draw thick+smooth lines:
void drawWideLine(int32_t x0, int32_t y0, int32_t x1, int32_t y1, float thick, COLOR color)
Draw thick+smooth lines (gradient fill):
void drawWideLine(int32_t x0, int32_t y0, int32_t x1, int32_t y1, float thick, const colors_t gradient)
Draw wedge line:
void drawWedgeLine(int32_t x0, int32_t y0, int32_t x1, int32_t y1, float thick0, float thick1, COLOR color)
Draw wedge line (gradient fill):
void drawWedgeLine(int32_t x0, int32_t y0, int32_t x1, int32_t y1, float thick0, float thick1, const colors_t gradient)
Fill smooth circle with single color (redundant with fillSmoothCircle(), kept for benchmark):
void drawSpot(int32_t x, int32_t y, float radius, COLOR fg_color)
Fill smooth circle, like fillSmoothCircle() but with gradient fill:
void drawGradientSpot(int32_t x, int32_t y, float radius, const colors_t gradient)
Draw antialiased line:
void drawSmoothLine( LovyanGFX* gfx, int32_t x0, int32_t y0, int32_t x1, int32_t y1, COLOR color )
Draw gradient line (not smoothed, used for filling):
void drawGradientLine(int32_t x0, int32_t y0, int32_t x1, int32_t y1, const colors_t gradient )
void drawGradientHLine(int32_t x, int32_t y, uint32_t w, const colors_t gradient )
void drawGradientVLine(int32_t x, int32_t y, uint32_t h, const colors_t gradient )
Fill rect with radial/linear gradient (fill_style_t can be any of RADIAL, HLINEAR or VLINEAR):
void fillGradientRect(int32_t x, int32_t y, uint32_t w, uint32_t h, COLOR start, COLOR end, fill_style_t style=RADIAL )
void fillGradientRect(int32_t x, int32_t y, uint32_t w, uint32_t h, const colors_t gradient, fill_style_t style=RADIAL )
Create a gradient item from a sized array of colors or from a pointer to an array of colors:
colors_t createGradient( rgb888_t[] colors )
colors_t createGradient( rgb888_t* colors, uint32_t count )
Example: