# `GSColorLine`

*Class*

A color line is a sorted collection of color stops used to describe a gradient.

## Declaration

```swift
class GSColorLine
```

```objc
@interface GSColorLine : NSObject
```

```python
class GSColorLine(NSObject)
```

## Overview

A rendition of the color line uses interpolation to determine the color values between the color stops. Color values are interpolated by linearly interpolating the color components in the linear sRGB color space.

## Topics

### Instance Properties

- [`GSColorLine.colorSpace`](/Core/GlyphsCore/GSColorLine/colorSpace) — The color space in which to perform interpolation of the color stops.
- [`GSColorLine.colorStops`](/Core/GlyphsCore/GSColorLine/colorStops) — The color stops of the color line.
- [`GSColorLine.parent`](/Core/GlyphsCore/GSColorLine/parent)
- [`GSColorLine.reversedColorLine`](/Core/GlyphsCore/GSColorLine/reversedColorLine) — Returns a new color line with equivalent color stops but in reversed order.

### Instance Methods

- [`GSColorLine CGGradientForEnvironment:`](/Core/GlyphsCore/GSColorLine/CGGradientForEnvironment:)
- [`GSColorLine colorLineClippedFrom:to:`](/Core/GlyphsCore/GSColorLine/colorLineClippedFrom:to:) — Returns a new color line representing the part of the receiver between `min` and `max`.
- [`GSColorLine colorLineScaledBy:`](/Core/GlyphsCore/GSColorLine/colorLineScaledBy:) — Returns a new color line equal to this color line except all color stop offsets are scaled by a given factor.
- [`GSColorLine countOfColorStops`](/Core/GlyphsCore/GSColorLine/countOfColorStops)
- [`GSColorLine elementDidChange:`](/Core/GlyphsCore/GSColorLine/elementDidChange:)
- [`GSColorLine init`](/Core/GlyphsCore/GSColorLine/init) — Creates a color line with the most recently registered color line.
- [`GSColorLine initWithBaseColor:`](/Core/GlyphsCore/GSColorLine/initWithBaseColor:) — Creates a color line that represented a subtle color sharing based on a single color.
- [`GSColorLine initWithColorStops:`](/Core/GlyphsCore/GSColorLine/initWithColorStops:) — Creates a color line with the given color stops.
- [`GSColorLine isEqualToColorLine:`](/Core/GlyphsCore/GSColorLine/isEqualToColorLine:)
- [`GSColorLine objectInColorStopsAtIndex:`](/Core/GlyphsCore/GSColorLine/objectInColorStopsAtIndex:)
- [`GSColorLine removeObjectFromColorStopsAtIndex:`](/Core/GlyphsCore/GSColorLine/removeObjectFromColorStopsAtIndex:)
- [`GSColorLine transformColorsUsingBlock:`](/Core/GlyphsCore/GSColorLine/transformColorsUsingBlock:) — See the docs for the equivalent method on [`GSFont`](/Core/GlyphsCore/GSFont).

### Type Methods

- [`GSColorLine setRecentColorLine:`](/Core/GlyphsCore/GSColorLine/setRecentColorLine:) — Register a color line as the most recently used color line for future reuse with `-[GSColorLine init]`.

## Relationships

### Inherits From

- `NSObject`

### Conforms To

- `NSCopying`

