# Horizontal gradient for line

**URL:** <https://discourse.processing.org/t/horizontal-gradient-for-line/35687>\
**Category:** Coding Questions\
**Created:** [March 11, 2022, 8:23pm UTC](https://discourse.processing.org/t/horizontal-gradient-for-line/35687 "2022-03-11T20:23:38Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [March 12, 2022, 12:52pm UTC](https://discourse.processing.org/t/horizontal-gradient-for-line/35687/2 "2022-03-12T12:52:25Z")

</div>

Hello @bringmeflowers,

> [@bringmeflowers](#):
>
> Here is the effect I try to achieve

This topic (Java version) may be of interest:

> [@Three parallel beziers](https://discourse.processing.org/t/three-parallel-beziers/34471/10):
>
> The answer is yes but the solution is not as simple as it might seem. The problem is that any curve that is “parallel and constant distance from a Bezier curve” (aka an offset curve) is not a Bezier curve so cannot be drawn using the bezier(...) function. The solution is described [here](https://pomax.github.io/bezierinfo/#offsetting) but as you can see it seems complicated. Fortunately Processing provides the necessary functions that allow us to calculate points on the offset curve which can be used to draw the offset curve. This image show…

I was able to achieve this with a few modifications:

![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/5/5cbf8fe303a4636b5b560ae88d72a59687503282.png)

`:)`

---

_[View the full topic](https://discourse.processing.org/t/horizontal-gradient-for-line/35687)._
