---
title: "Color Components | Explore SwiftUI"
description: "A representation of a color that adapts to a given context. Explore 10 SwiftUI color components with code examples for iOS, macOS, watchOS, tvOS, and visionOS."
canonical_url: "https://exploreswiftui.com/library/color"
meta:
  author: "Explore SwiftUI"
  "og:description": "A representation of a color that adapts to a given context. Explore 10 SwiftUI color components with code examples for iOS, macOS, watchOS, tvOS, and visionOS."
  "og:image": "https://exploreswiftui.com/_og/d/c_Default%2Ctitle_Color%2BComponents%2Cdescription_Explore%2B10%2BSwiftUI%2Bcomponents%2Bvisually%2Cp_Ii9saWJyYXJ5L2NvbG9yIg%2Cs_jyS_GwcgJSYTY2Qy.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Color Components | Explore SwiftUI"
  "twitter:description": "A representation of a color that adapts to a given context. Explore 10 SwiftUI color components with code examples for iOS, macOS, watchOS, tvOS, and visionOS."
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Default%2Ctitle_Color%2BComponents%2Cdescription_Explore%2B10%2BSwiftUI%2Bcomponents%2Bvisually%2Cp_Ii9saWJyYXJ5L2NvbG9yIg%2Cs_jyS_GwcgJSYTY2Qy.png"
  "twitter:title": "Color Components | Explore SwiftUI"
---

> Index of every page on this site: [llms.txt](https://exploreswiftui.com/llms.txt)

# **Color Components**

A representation of a color that adapts to a given context.

10 components

![Color Opacity - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/16/variants/124?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Color Opacity**

The Color opacity modifier

![Color Gradient - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/15/variants/143?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Color Gradient**

The Color gradient modifier

![Color Variants - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/9/variants/209?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Color Variants**

HierarchicalShapeStyle, a shape style that maps to one of the numbered content styles

![UIKit Separator Colors - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/14/variants/57?v=1790073478842&r=2&w=412&q=75&f=webp)

### **UIKit Separator Colors**

The UIKit separator colors that are also used in other components, such as the TextField

![UIKit Content Background colors - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/13/variants/53?v=1790073478842&r=2&w=412&q=75&f=webp)

### **UIKit Content Background colors**

The UIKit colors that are also used in other components like in List and GroupBox

![UIKit Text Colors - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/12/variants/55?v=1790073478842&r=2&w=412&q=75&f=webp)

### **UIKit Text Colors**

The UIKit text colors that are also used in other components, such as the TextField

![UIKit Fill Colors - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/11/variants/43?v=1790073478842&r=2&w=412&q=75&f=webp)

### **UIKit Fill Colors**

![UIKit Label Colors - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/10/variants/45?v=1790073478842&r=2&w=412&q=75&f=webp)

### **UIKit Label Colors**

![Semantic Colors - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/8/variants/51?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Semantic Colors**

![Standard Colors - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/7/variants/75?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Standard Colors**

The SwiftUI standard colors

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://exploreswiftui.com/#website","@type":"WebSite","description":"A visual library for SwiftUI APIs, components, and modifiers","inLanguage":"en-US","name":"Explore SwiftUI","url":"https://exploreswiftui.com/","publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/color#webpage","@type":"WebPage","description":"A representation of a color that adapts to a given context. Explore 10 SwiftUI color components with code examples for iOS, macOS, watchOS, tvOS, and visionOS.","name":"Color Components","url":"https://exploreswiftui.com/library/color","breadcrumb":{"@id":"https://exploreswiftui.com/library/color#breadcrumb"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/library/color"]}],"primaryImageOfPage":{"@id":"https://exploreswiftui.com/#logo"}},{"@id":"https://exploreswiftui.com/#identity","@type":"Organization","description":"A visual library for SwiftUI APIs, components, and modifiers","name":"Explore SwiftUI","url":"https://exploreswiftui.com","logo":{"@id":"https://exploreswiftui.com/#logo"},"sameAs":["https://x.com/Typ0genius","https://mastodon.social/@Typ0genius"]},{"@id":"https://exploreswiftui.com/library/color#collectionpage","@type":"CollectionPage","description":"A representation of a color that adapts to a given context. Explore 10 SwiftUI color components with code examples for iOS, macOS, watchOS, tvOS, and visionOS.","inLanguage":"en-US","name":"Color Components","url":"https://exploreswiftui.com/library/color","about":{"@type":"Thing","name":"SwiftUI"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"}},{"@id":"https://exploreswiftui.com/library/color#/schema/item-list/1","@type":"ItemList","name":"Color Components","itemListElement":[{"@type":"ListItem","position":1,"name":"Color Opacity","url":"https://exploreswiftui.com/library/color/color-opacity"},{"@type":"ListItem","position":2,"name":"Color Gradient","url":"https://exploreswiftui.com/library/color/color-gradient"},{"@type":"ListItem","position":3,"name":"Color Variants","url":"https://exploreswiftui.com/library/color/color-variants"},{"@type":"ListItem","position":4,"name":"UIKit Separator Colors","url":"https://exploreswiftui.com/library/color/uikit-separator-colors"},{"@type":"ListItem","position":5,"name":"UIKit Content Background colors","url":"https://exploreswiftui.com/library/color/uikit-content-background-colors"},{"@type":"ListItem","position":6,"name":"UIKit Text Colors","url":"https://exploreswiftui.com/library/color/uikit-text-colors"},{"@type":"ListItem","position":7,"name":"UIKit Fill Colors","url":"https://exploreswiftui.com/library/color/uikit-fill-colors"},{"@type":"ListItem","position":8,"name":"UIKit Label Colors","url":"https://exploreswiftui.com/library/color/uikit-label-colors"},{"@type":"ListItem","position":9,"name":"Semantic Colors","url":"https://exploreswiftui.com/library/color/semantic-colors"},{"@type":"ListItem","position":10,"name":"Standard Colors","url":"https://exploreswiftui.com/library/color/standard-colors"}]},{"@id":"https://exploreswiftui.com/library/color#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://exploreswiftui.com","position":1},{"@type":"ListItem","name":"Color","item":"https://exploreswiftui.com/library/color","position":2}]},{"@id":"https://exploreswiftui.com/#logo","@type":"ImageObject","caption":"Explore SwiftUI","contentUrl":"https://exploreswiftui.com/apple-touch-icon.png","inLanguage":"en","url":"https://exploreswiftui.com/apple-touch-icon.png"}]}
```