# createSlider()

### Example

<figure><img src="https://768248463-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqbs7pgU3AVBY06Rl9M31%2Fuploads%2F80SIr2QCmDJopKMBCr8h%2FcreateSlider.gif?alt=media&#x26;token=1801a162-a2c1-415a-ba71-be16c945f4ac" alt=""><figcaption></figcaption></figure>

```python
def setup():
  global slider1,slider2,slider3
  slider1 = createSlider(0, 255,1)
  slider1.position(50,40)
  slider2 = createSlider(0,255,1)
  slider2.position(50,60)
  slider3 = createSlider(0,255,1)
  slider3.position(50,80)
  
def draw():
  global slider1,slider2,slider3
  fill(slider1.value(),slider2.value(),slider3.value())
  circle(200,200,200)
```

### Syntax

```
createSlider(minimum, maximum, [initial_value], [step])
```

<table><thead><tr><th width="210">Input</th><th>Description</th></tr></thead><tbody><tr><td>minimum</td><td>minimum value of the slider</td></tr><tr><td>maximum</td><td>maximum value of the slider</td></tr><tr><td>initial_value(optional)</td><td>initial value of the slider</td></tr><tr><td>step(optional)</td><td>step size between values on the slider.</td></tr></tbody></table>

### Description

`createSlider()` function can be used to create a slider control . A slider control is a **graphical user interface element** that **allows the user to select a value** within a specified range **by dragging a handle along a track.**

To draw the slider control on the canvas, you can use the `draw()` function and the `value()` method of the slider object

{% hint style="info" %}
Find these documents helpful? Let the people who made them help your child learn to code at [**Strivemath**](https://www.strivemath.com/)<mark style="color:blue;">**!**</mark>

We'd love to hear your Feedback/Comments [here](https://docs.google.com/forms/d/e/1FAIpQLSeqorBAGTya-YBRI-VFjJxtgQtCz3ucGDI96K96sNyuaGuvdw/viewform?usp=sf_link).
{% endhint %}
