# Add gradient colors to lines

**URL:** <https://openrndr.discourse.group/t/add-gradient-colors-to-lines/754>\
**Category:** How to?\
**Created:** [September 2, 2025, 11:15pm UTC](https://openrndr.discourse.group/t/add-gradient-colors-to-lines/754 "2025-09-02T23:15:56Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![abe](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/abe/32/700_2.png) [@abe](https://openrndr.discourse.group/u/abe)\
**Post date:** [September 3, 2025, 10:18am UTC](https://openrndr.discourse.group/t/add-gradient-colors-to-lines/754/3 "2025-09-03T10:18:09Z")

</div>

By the way… there are many shade styles available in [orx/orx-shade-styles at master · openrndr/orx · GitHub](https://github.com/openrndr/orx/tree/master/orx-shade-styles) so you don’t need to write shaders yourself (many of them only available when using version 0.4.5).

I opened [this issue](https://github.com/openrndr/orx/issues/359) to be able to apply those same shade styles to strokes, not only fills.

Meanwhile I just figured out a little hack:

```kotlin
val img = loadImage("data/images/cheeta.jpg")
val ss = imageFill { image = img }
ss.fragmentTransform = ss.fragmentTransform?.replace("x_fill", "x_stroke")

```

Here I load an image and use the new `imageFill` shade style which works for fills only. But then in the next line I replace any mentions of x\_fill to x\_stroke and voilá! Now the style applies to lines instead 🙂

---

_[View the full topic](https://openrndr.discourse.group/t/add-gradient-colors-to-lines/754)._
