# Change color of line through scripting

**URL:** <https://forum.inductiveautomation.com/t/change-color-of-line-through-scripting/25472>\
**Category:** General Discussion\
**Tags:** scripting\
**Created:** [May 31, 2019, 6:25pm UTC](https://forum.inductiveautomation.com/t/change-color-of-line-through-scripting/25472 "2019-05-31T18:25:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bvaldovinos](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bvaldovinos/32/6315_2.png) [@bvaldovinos](https://forum.inductiveautomation.com/u/bvaldovinos)\
**Post date:** [May 31, 2019, 6:25pm UTC](https://forum.inductiveautomation.com/t/change-color-of-line-through-scripting/25472/1 "2019-05-31T18:25:36Z")

</div>

I have an SVG that I imported to my project. This shape has an outline that I would like to change the width and color of based on a custom property. I can change the width no problem, but how would I change the color of the line using this script?

I know that I can use the style customer to change the color based off a custom property. However, I would like to implement this to dozens of other templates that I’m using. Copy/pasting a script is faster than me copy/pasting a script AND setting up the Style Customizer.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/0/0d67d4b59d7ffcbce321891f6f7613b6c2704909.png)

```auto
logger = system.util.getLogger("Valve Template")
startLogging = system.tag.read("[Client]InfoDebug").value
# manual mode has been set. 
if event.propertyName == "manual":
	if event.source.manual == True:
		from java.awt import BasicStroke
		lineWidth = 2
		if startLogging: logger.info("Property: %s" % event.propertyName)
		event.source.setStrokeStyle(BasicStroke(lineWidth))
	if event.source.manual == False:
		from java.awt import BasicStroke
		lineWidth = 0.582
		if startLogging: logger.info("Property: %s" % event.propertyName)
		event.source.setStrokeStyle(BasicStroke(lineWidth))
		

```

---

<div class="post-metadata">

**Author:** ![nick.schuetz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nick.schuetz/32/6160_2.png) [@nick.schuetz](https://forum.inductiveautomation.com/u/nick.schuetz)\
**Post date:** [May 31, 2019, 6:56pm UTC](https://forum.inductiveautomation.com/t/change-color-of-line-through-scripting/25472/2 "2019-05-31T18:56:53Z")

</div>

```auto
from java.awt import Color
event.source.setStrokePaint(Color.white)
event.source.setFillPaint(Color.gray)

```

Some combination of the StrokePaint and FillPaint should work.
