---
description: API for creating and modifying polygon style objects.
---

# JSPolygonStyle

> Create a API with Module.JSPolygonStyle.
>
> JSPolygonStyle allows for the bulk specification of styles for multiple polygon objects.

```javascript
var objectStyle = new Module.JSPolygonStyle();
```

## Getter / Setter

### getFill(), setFill(fill) → boolean

> Sets whether the object's fill color is applied.
>
> If not set, it is applied (true).

{% tabs %}
{% tab title="Information" %}
| Name | Type    | Description                                                                                     |
| ---- | ------- | ----------------------------------------------------------------------------------------------- |
| fill | boolean | <p>Whether to apply the object's fill color.<br>true to apply color.<br>false to not apply.</p> |

* Return
  * true: Fill color applied.
  * false: Fill color not applied.
{% endtab %}

{% tab title="Template" %}
```javascript
var bOutlineUsed = polygon.getStyle().getFill();
// ... or ...
var figure = new Module.JSFigure();
// ...
var polyStyle = figure.getStyle();
polyStyle.setFill(true);
```
{% endtab %}
{% endtabs %}

### getFillColor(), setFillColor(color) → [JSColor](../core/jscolor)

> Sets the fill color of the object's style.

{% tabs %}
{% tab title="Information" %}
| Name  | Type                       | Description                 |
| ----- | -------------------------- | --------------------------- |
| color | [JSColor](../core/jscolor) | The color object to be set. |

* Return
  * [JSColor](../core/jscolor): The color object to be set.
{% endtab %}

{% tab title="Template" %}
```javascript
var figure = new Module.JSFigure();
//...
var polyStyle = figure.getStyle();
var fillColor = polyStyle.getFillColor();
// ... or ...
var polyStyle = figure.getStyle();
var fillColor = new Module.JSColor(255, 255, 100, 0);
polyStyle.setFillColor(fillColor);
```
{% endtab %}
{% endtabs %}

### getOutLine(), setOutLine(set) → boolean

> Sets whether the object's outline color is applied.
>
> If not set, it is applied (true).

{% tabs %}
{% tab title="Information" %}
| Name | Type    | Description                                                                               |
| ---- | ------- | ----------------------------------------------------------------------------------------- |
| set  | boolean | <p>Whether to apply the outline color.<br>true to apply color.<br>false to not apply.</p> |

* Return
  * true: Outline color applied.
  * false: Outline color not applied.
{% endtab %}

{% tab title="Template" %}
```javascript
var bOutlineUsed = polygon.getStyle().getOutLine();
// ... or ...
var figure = new Module.JSFigure();
//...
var polyStyle = figure.getStyle();
polyStyle.setOutLine(false);
```
{% endtab %}
{% endtabs %}

### getOutLineColor(), setOutLineColor(color) → [JSColor](../core/jscolor)

> Sets the outline color of the object's style.

{% tabs %}
{% tab title="Information" %}
| Name  | Type                       | Description                 |
| ----- | -------------------------- | --------------------------- |
| color | [JSColor](../core/jscolor) | The color object to be set. |

* Return
  * [JSColor](../core/jscolor): The set outline color.
{% endtab %}

{% tab title="Template" %}
```javascript
var figure = new Module.JSFigure();
//...
var polyStyle = figure.getStyle();
var outlineColor = polyStyle.getOutLineColor();
// ... or ...
var figure = new Module.JSFigure();
//...
var polyStyle = figure.getStyle();
var outlineColor = new Module.JSColor(255, 255, 0, 0);
polyStyle.setOutLineColor(outlineColor);
```
{% endtab %}
{% endtabs %}
