# `GSFont setColorSpace:usingMethod:`

*Instance Method*

Changes the color space used by document colors in the font.

## Declaration

```swift
func setColorSpace(_ colorSpace: GSColorSpace, using changeMethod: GSColorSpaceChangeMethod)
```

```objc
- (void) setColorSpace:(GSColorSpace *) colorSpace usingMethod:(GSColorSpaceChangeMethod) changeMethod;
```

```python
setColorSpace_usingMethod_(colorSpace: GSColorSpace, changeMethod: GSColorSpaceChangeMethod)
```

## Parameters

- `colorSpace` — The RGB color space to use for document colors.
- `changeMethod` — The method used to update existing RGB colors.

## Discussion

The new color space must follow the RGB color space model. Non-RGB colors are not changed.

See [`GSFont transformColorsUsingBlock:`](/Core/GlyphsCore/GSFont/transformColorsUsingBlock:) for details on which colors are affected.

This method is also run when the given color space is the same as the color space of the font. This is done so that setting the font’s color space can be used to update stale color values in the font.

## See Also

### Colors

- [`GSFont.colorSpace`](/Core/GlyphsCore/GSFont/colorSpace) — The RGB color space used by document colors in the font.
- [`GSFont matchingColorFromColor:`](/Core/GlyphsCore/GSFont/matchingColorFromColor:) — Returns the given color converted to match the color space of the font.
- [`GSFont transformColorsUsingBlock:`](/Core/GlyphsCore/GSFont/transformColorsUsingBlock:) — Passes each document color to the given block and updates it if the block returns a new color.

