<!--
{
  "documentType" : "article",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/customizing-drawings",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Customizing drawings"
}
-->

# Customizing drawings

Create custom colors and patterns for drawing in your app.

## Discussion

You can customize the colors in your app, including the background and tint colors and the drawing styles available to users of your app.

### Set custom background and tint colors

The most common way to use a [`UIColor`](/documentation/UIKit/UIColor) object is to include it with some other object in UIKit. Including [`UIColor`](/documentation/UIKit/UIColor) with an object in UIKit allows you to create and customize the UI of your app. For example, the [`UIView`](/documentation/UIKit/UIView) class (and its descendants) includes background and tint colors to affect how they’re drawn onscreen. The following code example sets the background and tint color of a view.

```swift
backgroundView.backgroundColor = UIColor.systemGray
backgroundView.tintColor = UIColor.systemBlue
```

### Create custom colors and drawing styles

When customizing drawings in your app, a [`UIColor`](/documentation/UIKit/UIColor) object provides methods that set the fill or stroke colors of the current graphics context. These methods can set the color of an object and create various patterns and styles. The following code shows a simple example of a custom drawing inside a view.

```swift
class CircleView: UIView {
    
    override func draw(_ rect: CGRect) {
        let ovalBounds = self.bounds.insetBy(dx: 10, dy: 10)
        let oval = UIBezierPath(ovalIn: ovalBounds)
        let brightRed = UIColor(displayP3Red: 1.0, green: 0.0, blue: 0.0, alpha: 1.0)
        brightRed.setFill()
        oval.fill()
    }
}
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)