๐ฆColor
SwiftUI โฉ shapes โฉ ShapeStyle โฉ Color
Color
custom extensions๏ผ
// predefined colors
let red = Color.red
// Specify component values
let skyBlue = Color(red: 0.4627, green: 0.8392, blue: 1.0) // RGB
let lemonYellow = Color(hue: 0.1639, saturation: 1, brightness: 1) // HSB
let steelGray = Color(white: 0.4745)
// Load a color from an Asset Catalog
let aqua = Color("aqua")
// Create a color instance from another color
#if os(iOS)
let linkColor = Color(uiColor: .link) // UIColor
#elseif os(macOS)
let linkColor = Color(nsColor: .linkColor) // NSColor
#endif
// from Asset Catalog
let aqua = Color("aqua")
// RGB / HSL / grayscale
let skyBlue = Color(red: 0.46, green: 0.84, blue: 1.0)
let lemonYellow = Color(hue: 0.16, saturation: 1, brightness: 1)
let steelGray = Color(white: 0.47)
// from UIColor / NSColor:
#if os(iOS)
let linkColor = Color(uiColor: .link)
#elseif os(macOS)
let linkColor = Color(nsColor: .linkColor)
#endif
// predefined colors:
[.black, .green, .purple]
Color Names
Robert Cooper โฉ Color Namer
Chirag Mehta โฉ Name that Color
Palettes
SwiftUI โฉ ShapeStyle โฉ
Color โฉ ShapeStyle Implementations - define system colors (again).
List โฉ View Implementations โฉ saturation(_:)
Core Image โฉ Applying a Chroma Key Effect โญ๏ธ - a.k.a. bluescreening or greenscreening.
Human Interface Guidelines โฉ System Colors - colorful swatches.
UIKit โฉ UIColor โฉ
Standard Colors - .systemBlue, .systemBrown ...
UI Element Colors - .
systemBackground
, ...
Last updated