# `GSPalettes addAttribute:toPalette:`

*Instance Method*

Adds an attribute to the specified palette index.

## Declaration

```swift
func add(_ attribute: GSPalettes.Attribute, toPalette paletteIdx: UInt)
```

```objc
- (void) addAttribute:(GSPalettesAttribute) attribute toPalette:(NSUInteger) paletteIdx;
```

```python
addAttribute_toPalette_(attribute: GSPalettesAttribute, paletteIdx: int)
```

## Parameters

- `attribute` — The attribute to add.
- `paletteIdx` — The index of the palette.

