wip
This commit is contained in:
30
Workouts/Utils/Color+color.swift
Normal file
30
Workouts/Utils/Color+color.swift
Normal file
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Color+color.swift
|
||||
// Workouts
|
||||
//
|
||||
// Created by rzen on 7/17/25 at 10:41 AM.
|
||||
//
|
||||
// Copyright 2025 Rouslan Zenetl. All Rights Reserved.
|
||||
//
|
||||
|
||||
import SwiftUICore
|
||||
|
||||
extension Color {
|
||||
static func color (from: String) -> Color {
|
||||
switch from {
|
||||
case "red": return .red
|
||||
case "orange": return .orange
|
||||
case "yellow": return .yellow
|
||||
case "green": return .green
|
||||
case "mint": return .mint
|
||||
case "teal": return .teal
|
||||
case "cyan": return .cyan
|
||||
case "blue": return .blue
|
||||
case "indigo": return .indigo
|
||||
case "purple": return .purple
|
||||
case "pink": return .pink
|
||||
case "brown": return .brown
|
||||
default: return .black
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user