# Changing features form component without changing source code?

**URL:** <https://discourse.psychopy.org/t/changing-features-form-component-without-changing-source-code/9299>\
**Category:** Builder\
**Created:** [October 4, 2019, 2:06pm UTC](https://discourse.psychopy.org/t/changing-features-form-component-without-changing-source-code/9299 "2019-10-04T14:06:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oceane](https://avatars.discourse-cdn.com/v4/letter/o/8e8cbc/32.png) [@Oceane](https://discourse.psychopy.org/u/Oceane)\
**Post date:** [October 4, 2019, 2:06pm UTC](https://discourse.psychopy.org/t/changing-features-form-component-without-changing-source-code/9299/1 "2019-10-04T14:06:21Z")

</div>

**OS** (e.g. Win10): Win10  
**PsychoPy version** (e.g. 1.84.x): 3.2.3  
**Standard Standalone? (y/n)** If not then what?: y  
**What are you trying to achieve?:** Changing details in the form component (e.g., radio button color) without changing the source code

Hello!  
I try to change some details in my experiment, especially default colors. I take the example of the form, slider type ‘radio’. The default color of the radio button is red when clicked.  
I went to the visual \> slider code and changed the color there.

But I have to put my experiment on approx. 20 computers and I don’t feel like changing the coe everywhere, especially because I will not be the only one to use psychopy there.

Can I make these changes in a code component? I tried, but it doesn’t seem to work (I can’t link my code to the slider code for example).

Any ideas? Thank you!!

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [October 7, 2019, 9:45am UTC](https://discourse.psychopy.org/t/changing-features-form-component-without-changing-source-code/9299/2 "2019-10-07T09:45:58Z")

</div>

Hi @Oceane, in the “Begin Experiment” tab, you can add the following line of code, to change the slider marker color

```auto
slider.marker.color = "green"

```

---

<div class="post-metadata">

**Author:** ![Oceane](https://avatars.discourse-cdn.com/v4/letter/o/8e8cbc/32.png) [@Oceane](https://discourse.psychopy.org/u/Oceane)\
**Post date:** [October 7, 2019, 9:51am UTC](https://discourse.psychopy.org/t/changing-features-form-component-without-changing-source-code/9299/3 "2019-10-07T09:51:54Z")

</div>

Hello @dvbridges,  
it works for sliders indeed.  
Yet in this case I use the slider within the form component, and this line doesn’t work (NameError: name ‘slider’ is not defined). It makes sense because with the form there is no slider as such.

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [October 7, 2019, 10:12am UTC](https://discourse.psychopy.org/t/changing-features-form-component-without-changing-source-code/9299/4 "2019-10-07T10:12:28Z")

</div>

Sorry, I misread! You could instead try the following (where your Form component is called `yourForm`):

```auto
# Begin Experiment
for item in yourForm.formElements['response']:
    item.marker.color = "green"

```

There are some new Form features that should be in the next release, such as ability to set question text and response colors.

---

<div class="post-metadata">

**Author:** ![Oceane](https://avatars.discourse-cdn.com/v4/letter/o/8e8cbc/32.png) [@Oceane](https://discourse.psychopy.org/u/Oceane)\
**Post date:** [October 18, 2019, 3:56pm UTC](https://discourse.psychopy.org/t/changing-features-form-component-without-changing-source-code/9299/5 "2019-10-18T15:56:30Z")

</div>

Hey @dvbridges,  
ok so this works and thank you, however I am totally unable to apply the logic to other features (e.g., text color, lines thickness) ☹
