# Turn gauge arc into gradient

**URL:** https://discourse.processing.org/t/turn-gauge-arc-into-gradient/4103
**Category:** Electronics (Arduino, etc.)
**Created:** [October 3, 2018, 11:18pm UTC](https://discourse.processing.org/t/turn-gauge-arc-into-gradient/4103 "2018-10-03T23:18:47Z")
**Posts on this page:** 1
**Showing post:** 13

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [October 13, 2018, 10:09pm UTC](https://discourse.processing.org/t/turn-gauge-arc-into-gradient/4103/13 "2018-10-13T22:09:31Z")

</div>

There are several approaches to this problem. Some include:

1. draw many tiny arc segments to create a gradient (solution from @Ov3rM1nD above)
2. create a closed PShape in the shape of an arc and fill with a gradient (e.g. a PShader)
3. draw a full gradient image, then draw a single arc as a mask and apply to “cut-out” your gradient.

For examples and past discussion of the mask-based approach, see:

 ![](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/b/b5c72bfe271a446173cde8b6af58c16f5a58551f.gif)

- [https://forum.processing.org/two/discussion/20005/2d-gui-libraries](https://forum.processing.org/two/discussion/20005/2d-gui-libraries)
- [https://forum.processing.org/two/discussion/18818/how-to-draw-a-transparent-pgraphics-image-solved](https://forum.processing.org/two/discussion/18818/how-to-draw-a-transparent-pgraphics-image-solved)
- [https://forum.processing.org/two/discussion/23886/masking-a-shape-with-another-shape](https://forum.processing.org/two/discussion/23886/masking-a-shape-with-another-shape)

There is also a related library:

> **[L3Dnam/Professional-Gauges-with-Processing](https://github.com/L3Dnam/Professional-Gauges-with-Processing)**
>
> If are looking for a professional Gauges looks like, this will help you. Created with Processing 3.3.5 - L3Dnam/Professional-Gauges-with-Processing

---

_[View the full topic](https://discourse.processing.org/t/turn-gauge-arc-into-gradient/4103)._
