Designing and Implementing the Ultimate Color Palette for Your App: A Journey

Abdullah Bilgin
Swift Insights
Published in
6 min readAug 27, 2023

Introduction

App creation goes beyond functionality; the aesthetic and visual components ensure users have a pleasant and seamless experience. In this journey, we embarked on the mission to perfect the color palette design, implementation, testing, and documentation of our latest app. Here’s a detailed walk-through of the process.

  1. Color Palette Design

Task 1.1: At the heart of our visual design was the creation of a cultural color palette, which took inspiration from global aesthetics to make the app more inclusive. Considering a wider audience, we code for both light and dark modes.

This PDF details our app’s globally-inspired color palette, with hex codes for both light and dark modes and their cultural inspirations

Task 1.2: Using various devices/screens, from smartphones to tablets, we ensured that our color palette remained consistent across platforms, taking into account factors like color gamut and screen brightness.

2. Color Implementation

Task 2.1: With the colors finalized, we seamlessly added them to our asset catalog, ensuring they were easily accessible to our developers and designers.

Asset Catalog

Task 2.2: To further streamline the process and avoid discrepancies, we created a dedicated Swift file named `Color+Extensions.swift`. This file housed our color extensions, making it more straightforward to implement these colors throughout the app.

import SwiftUI

extension Color {
// MARK: - Modern Cultural Color Palette

// Sahara Sun
static let saharaSun = Color("SaharaSun")

// Mediterranean Blue
static let mediterraneanBlue = Color("MediterraneanBlue")

// Bamboo Forest
static let bambooForest = Color("BambooForest")

// Cherry Blossom Pink
static let cherryBlossomPink = Color("CherryBlossomPink")

// Himalayan Stone
static let himalayanStone = Color("HimalayanStone")

// Carnival Red
static let carnivalRed = Color("CarnivalRed")

// Aurora Purple
static let auroraPurple = Color("AuroraPurple")
}

For example:

Rectangle()
.fill(Color.saharaSunLight)
.frame(width: 100, height: 100)

Remember to add this code to your Swift project, and then you can easily reference the colors in your SwiftUI views.

Task 2.3: If a project starts with hardcoded colors, managing and ensuring consistency can become tedious and error-prone, especially as the app grows. To address this, we refactored our existing SwiftUI views to utilize the newly created color extensions. By moving away from manually inputting hex codes to leveraging these extensions, our developers not only streamlined the development process but also significantly reduced the potential for errors. For projects that already use a systematic approach to color management from the start, this step might not be necessary. However, for our needs, this refactoring played a crucial role in enhancing the app’s maintainability and scalability.

Task 2.4: Recognizing dark mode's rising popularity, we ensured our app wasn’t left behind. Dynamic color adjustments were implemented, ensuring our app looked stunning, irrespective of the user’s preferred mode.

Light — Dark Mode

3. Color Testing and Validation

Task 3.1: To ensure our colors looked just as we envisioned, we developed the `ColorShowcaseView. This view was instrumental in allowing us to visualize and test our app’s color palette in both light and dark modes.

import SwiftUI

struct ColorShowcaseView: View {

let colors: [(name: String, color: Color)] = [
("Sahara Sun", Color("SaharaSun")),
("Mediterranean Blue", Color("MediterraneanBlue")),
("Bamboo Forest", Color("BambooForest")),
("Cherry Blossom Pink", Color("CherryBlossomPink")),
("Himalayan Stone", Color("HimalayanStone")),
("Carnival Red", Color("CarnivalRed")),
("Aurora Purple", Color("AuroraPurple"))
]

var body: some View {
ScrollView {
VStack(spacing: 20) {
ForEach(colors, id: \.name) { colorInfo in
ColorCard(name: colorInfo.name, color: colorInfo.color)
}
}
.padding()
}
}
}

struct ColorCard: View {
var name: String
var color: Color

var body: some View {
VStack {
color
.frame(width: 200, height: 200)
.cornerRadius(20)
.shadow(radius: 10)

Text(name)
.font(.title2)
.padding(.top, 10)
}
.frame(maxWidth: .infinity)
.cornerRadius(20)
.shadow(color: Color.black.opacity(0.15), radius: 10, x: 0, y: 5)
.padding()
}
}

struct ColorShowcaseView_Previews: PreviewProvider {
static var previews: some View {
Group {
ColorShowcaseView()
ColorShowcaseView().environment(\.colorScheme, .dark)
}
}
}

Task 3.2: Accessibility remains at the forefront of our design principles. We rigorously tested color contrast ratios between text and backgrounds. This ensured that every user, including those with visual impairments, had an uninterrupted and readable experience.

Task 3.3: Still pending completion, our next step involves gathering feedback from potential users and team members. This will help us make informed decisions regarding any color palette adjustments.

4. Documentation and Committing

Task 4.1: Transparency and documentation form the backbone of our development process. We meticulously documented the color palette’s inspirations, significance, and guidelines on how to use it. This documentation will serve as a reference for any future designers or developers.


# Modern Cultural Color Palette Guide

This palette has been carefully curated to reflect modern hues inspired by various cultures, landscapes, and moments in time. Below is a detailed breakdown of each color, its name, and guidance on its potential use in your application.

---

## 1. **Sahara Sun**

- **Hex**: (You'll have to provide the exact color value)
- **SwiftUI Extension**: `Color.saharaSun`
- **Inspiration**: The vast and warm expanse of the Sahara Desert.
- **Usage**: Ideal for main UI elements that need a warm and inviting touch.

---

## 2. **Mediterranean Blue**

- **Hex**: (You'll have to provide the exact color value)
- **SwiftUI Extension**: `Color.mediterraneanBlue`
- **Inspiration**: The deep and calming waters of the Mediterranean Sea.
- **Usage**: Perfect for elements that require a calm and serene touch, or to offset warmer tones.

---

## 3. **Bamboo Forest**

- **Hex**: (You'll have to provide the exact color value)
- **SwiftUI Extension**: `Color.bambooForest`
- **Inspiration**: The peaceful and rejuvenating groves of bamboo forests.
- **Usage**: Suitable for backgrounds, buttons, or UI elements that need a touch of nature.

---

## 4. **Cherry Blossom Pink**

- **Hex**: (You'll have to provide the exact color value)
- **SwiftUI Extension**: `Color.cherryBlossomPink`
- **Inspiration**: The ephemeral beauty of cherry blossoms in full bloom.
- **Usage**: Ideal for accenting elements or for feminine design touches.

---

## 5. **Himalayan Stone**

- **Hex**: (You'll have to provide the exact color value)
- **SwiftUI Extension**: `Color.himalayanStone`
- **Inspiration**: The rugged and majestic stones of the Himalayan range.
- **Usage**: Perfect for secondary texts, borders, or a touch of natural elegance.

---

## 6. **Carnival Red**

- **Hex**: (You'll have to provide the exact color value)
- **SwiftUI Extension**: `Color.carnivalRed`
- **Inspiration**: The vibrancy and energy of bustling carnivals.
- **Usage**: Suitable for interactive elements or calls to action that need to stand out.

---

## 7. **Aurora Purple**

- **Hex**: (You'll have to provide the exact color value)
- **SwiftUI Extension**: `Color.auroraPurple`
- **Inspiration**: The mesmerizing dance of the Northern Lights in the night sky.
- **Usage**: Ideal for design accents, highlighting important information, or to introduce a touch of magic.

---

This guide should help developers and designers to understand and efficiently implement the color palette in the application. Always consider accessibility and contrast when utilizing colors, especially for text against various backgrounds.

Task 4.2: Keeping our codebase updated, we committed all color changes, extensions, and related implementations to our Git repository, ensuring that every team member was aligned with the latest developments.

5. Future Iterations

Task 5.1: Our job isn't over once our app goes live. We’re actively monitoring user feedback, mainly focusing on the app’s aesthetics and color choices. This real-world feedback will be invaluable in refining our design.

Task 5.2: As part of our commitment to continuous improvement, we’re already brainstorming potential color adjustments or expansions for future app updates. While this task is ongoing, we’re confident that our app’s visual design will evolve, always for the better.

Conclusion

The journey to perfecting an app’s color palette is intricate and multi-faceted. It’s a blend of art, science, and user feedback. With our systematic approach, we’ve created an app that isn’t just functional and a visual treat. Our commitment to design excellence remains unwavering as we embark on future updates. We invite you to experience the vibrant world we’ve painted!

Thank you for venturing alongside me through the intricacies of the ‘ModernColorPaletteShowcase’. As we navigated the vibrant hues and shades that define our app, I trust you’ve acquired a deeper appreciation for the role colors play in creating compelling user interfaces. Whether you’re an adept designer or just stepping into the world of UI/UX, always remember that each color choice paints an emotion, tells a story, and sets a mood. Your feedback and reflections are invaluable to this journey, so please share them below. Let’s continue to craft, inspire, and innovate. Cheers to a world full of color!

--

--

Abdullah Bilgin
Swift Insights

"iOS engineer & IT head, crafting code & innovation. Leading with tech prowess & strategic vision. Bridging iOS dev & IT realms. Lifelong learner. 📱💡"