---
title: set()
framework: uikit
role: symbol
role_heading: Instance Method
path: uikit/uicolor/set()
---

# set()

Sets the color of subsequent stroke and fill operations to the color that the receiver represents.

## Declaration

```swift
func set()
```

## Discussion

Discussion If you subclass UIColor, you must implement this method in your subclass. Your custom implementation should modify both the stroke and fill color in the current graphics context by setting them both to the color represented by the receiver.

## See Also

### Applying the color to the drawing environment

- [Customizing drawings](uikit/customizing-drawings.md)
- [setFill()](uikit/uicolor/setfill().md)
- [setStroke()](uikit/uicolor/setstroke().md)
