# `GSGradient`

*Class*

## Declaration

```swift
class GSGradient
```

```objc
@interface GSGradient : GSElement
```

```python
class GSGradient(GSElement)
```

## Topics

### Instance Properties

- [`GSGradient.colorLine`](/Core/GlyphsCore/GSGradient/colorLine)
- [`GSGradient.extendMode`](/Core/GlyphsCore/GSGradient/extendMode)
- [`GSGradient.transform`](/Core/GlyphsCore/GSGradient/transform) — A transform that is applied to the gradient independently from the region that is filled with the gradient.
- [`GSGradient.type`](/Core/GlyphsCore/GSGradient/type)

### Instance Methods

- [`GSGradient convertedToType:`](/Core/GlyphsCore/GSGradient/convertedToType:) — Converts the gradient to the given type while trying to match the UI of the gradient as closely as possible.
- [`GSGradient drawWithReferenceRect:environment:`](/Core/GlyphsCore/GSGradient/drawWithReferenceRect:environment:) — Draws the gradient in the current graphics context, transforming the gradient control points based on the given reference rectangle.
- [`GSGradient drawBounds`](/Core/GlyphsCore/GSGradient/drawBounds) — Returns the bounds of the draw stack slice of which the path of the gradient is a part.
- [`GSGradient initWithPropertyListValue:format:`](/Core/GlyphsCore/GSGradient/initWithPropertyListValue:format:)

### Type Methods

- [`GSGradient gradientWithType:bounds:baseColor:`](/Core/GlyphsCore/GSGradient/gradientWithType:bounds:baseColor:)

## Relationships

### Inherits From

- [`GSElement`](/Core/GlyphsCore/GSElement)

### Inherited By

- [`GSConicGradient`](/Core/GlyphsCore/GSConicGradient)
- [`GSLinearGradient`](/Core/GlyphsCore/GSLinearGradient)
- [`GSRadialGradient`](/Core/GlyphsCore/GSRadialGradient)

