---
title: locations
framework: quartzcore
role: symbol
role_heading: Instance Property
path: quartzcore/cagradientlayer/locations
---

# locations

An optional array of NSNumber objects defining the location of each gradient stop. Animatable.

## Declaration

```swift
var locations: [NSNumber]? { get set }
```

## Discussion

Discussion The gradient stops are specified as values between 0 and 1. The values must be monotonically increasing. If nil, the stops are spread uniformly across the range. Defaults to nil. When rendered, the colors are mapped to the output color space before being interpolated.

## See Also

### Gradient Style Properties

- [colors](quartzcore/cagradientlayer/colors.md)
- [endPoint](quartzcore/cagradientlayer/endpoint.md)
- [startPoint](quartzcore/cagradientlayer/startpoint.md)
- [type](quartzcore/cagradientlayer/type.md)
