# Settings

## Registering a new setting

You can register settings by putting them in the object when registering a module. In the following example we will create a new [`Module`](module) and give it a [`BooleanSetting`](settings/booleansetting) and a [`ColorSetting`](settings/colorsetting).

```javascript
breeze.registerModule("TestModule", "A module with settings!", {
    'aSetting': new BooleanSetting("Value", "A very important choice to make", false),
    'theColor': new ColorSetting("Color", "Everyone likes a cool color", new Color(29, 201, 150), false),
    
    'enable': function() {
        //we can change the behaviour of the module based on the values of the settings
        if (this.aSetting.getValue()) {
            breeze.log("Great choice!", this.theColor.getValue())
        } else {
            breeze.log(this.aSetting.getName() + " was not set to true")
        }
    }
}) 
```

## Getting a existing setting

You can get a setting by using the [`getSetting(String name);`](../module#getsetting-string-name-setting) method on a [`Module`](module). If the module has a setting with the given name it will return a `Setting object`.

<pre class="language-javascript"><code class="lang-javascript">//Example of getting a setting and changing its value.

<strong>var aimAssist = breeze.getModule("AimAssist")
</strong>var range = aimAssist.getSetting("Range")
range.setValue(3.5)

//this code can all be compressed in to one line if wanted
breeze.getModule("AimAssist").getSetting("Range").setValue(3.5)
</code></pre>
