# ShapeContainerMixin.createFill
Adds a fill paint to this container

{/* Do not edit this file. It is automatically generated by API Documenter. */}

## ShapeContainerMixin.createFill() method

Adds a fill paint to this container

**Signature:**

```typescript
createFill(opts: PaintOptions): Paint;
```

## Parameters

<table>
  <thead>
    <tr>
      <th>
        Parameter
      </th>

      <th>
        Type
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        opts
      </td>

      <td>
        [PaintOptions](../../types/paint-options)
      </td>

      <td>
        The paint options
      </td>
    </tr>
  </tbody>
</table>

**Returns:**

[Paint](../../types/paint)

The newly created paint

## Example

```ts
// Create a solid red paint
layer.createFill({
  type: "SOLID",
  color: { r: 255, g: 0, b: 0 },
});

// Create a gradient with default positioning (spans shape width)
layer.createFill({
  type: "GRADIENT_LINEAR",
  stops: [
    { color: { r: 255, g: 0, b: 0 }, offset: 0, opacity: 1 },
    { color: { r: 0, g: 0, b: 255 }, offset: 1, opacity: 1 },
  ],
});
```
