# `GSGradient drawWithReferenceRect:environment:`

*Instance Method*

Draws the gradient in the current graphics context, transforming the gradient control points based on the given reference rectangle.

## Declaration

```swift
func draw(withReferenceRect referenceRect: NSRect, environment: GSDrawEnvironment)
```

```objc
- (void) drawWithReferenceRect:(NSRect) referenceRect environment:(GSDrawEnvironment *) environment;
```

```python
drawWithReferenceRect_environment_(referenceRect: NSRect, environment: GSDrawEnvironment)
```

