Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Woo POS] [Design System] Create a color palette for POS and corresponding SwiftUI colors #15063

Merged
merged 3 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions WooCommerce/Classes/POS/Colors/Color+POSColorPalette.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import SwiftUI

extension Color {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So many colors 😀 Fingers crossed it will be comfortable to work with 🤞

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

31 new colors 😄 as long as the design uses it, it's been great not having to worry about dark mode.

// MARK: - Primary Colors
static var posPrimary: Color { Color(.posPrimary) }
static var posOnPrimary: Color { Color(.posOnPrimary) }
static var posPrimaryContainer: Color { Color(.posPrimaryContainer) }
static var posOnPrimaryContainer: Color { Color(.posOnPrimaryContainer) }

// MARK: - Secondary Container Colors
static var posSecondaryContainer: Color { Color(.posSecondaryContainer) }
static var posOnSecondaryContainer: Color { Color(.posOnSecondaryContainer) }

// MARK: - Disabled Container Colors
static var posDisabledContainer: Color { Color(.posDisabledContainer) }
static var posOnDisabledContainer: Color { Color(.posOnDisabledContainer) }

// MARK: - Surface Colors
static var posSurface: Color { Color(.posSurface) }
static var posOnSurface: Color { Color(.posOnSurface) }
static var posSurfaceDim: Color { Color(.posSurfaceDim) }
static var posSurfaceBright: Color { Color(.posSurfaceBright) }
static var posSurfaceContainerLowest: Color { Color(.posSurfaceContainerLowest) }
static var posSurfaceContainerLow: Color { Color(.posSurfaceContainerLow) }
static var posSurfaceContainerHighest: Color { Color(.posSurfaceContainerHighest) }

// MARK: - Surface Variant Colors
static var posOnSurfaceVariantLowest: Color { Color(.posOnSurfaceVariantLowest) }
static var posOnSurfaceVariantHighest: Color { Color(.posOnSurfaceVariantHighest) }

// MARK: - Inverse Surface Colors
static var posInverseSurface: Color { Color(.posInverseSurface) }
static var posOnInverseSurface: Color { Color(.posOnInverseSurface) }

// MARK: - Outline Colors
static var posOutline: Color { Color(.posOutline) }
static var posOutlineVariant: Color { Color(.posOutlineVariant) }

// MARK: - Status Colors
static var posError: Color { Color(.posError) }
static var posOnError: Color { Color(.posOnError) }
static var posSuccess: Color { Color(.posSuccess) }
static var posOnSuccess: Color { Color(.posOnSuccess) }
static var posAlert: Color { Color(.posAlert) }
static var posOnAlert: Color { Color(.posOnAlert) }

// MARK: - Text Colors
static var posTextPrimary: Color { Color(.posTextPrimary) }
static var posTextSecondary: Color { Color(.posTextSecondary) }
static var posTextTertiary: Color { Color(.posTextTertiary) }

// MARK: - Other
static var posShadow: Color { Color(.posShadow) }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x18",
"green" : "0x66",
"red" : "0xF1"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x18",
"green" : "0x66",
"red" : "0xF1"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xDE",
"green" : "0xDC",
"red" : "0xDC"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x5E",
"green" : "0x57",
"red" : "0x50"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x38",
"green" : "0x36",
"red" : "0xD6"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x38",
"green" : "0x36",
"red" : "0xD6"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x17",
"green" : "0x15",
"red" : "0x10"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xFF",
"green" : "0xFF",
"red" : "0xFF"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xFF",
"green" : "0xFF",
"red" : "0xFF"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xFF",
"green" : "0xFF",
"red" : "0xFF"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xAD",
"green" : "0xAA",
"red" : "0xA7"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x82",
"green" : "0x7C",
"red" : "0x78"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xFF",
"green" : "0xFF",
"red" : "0xFF"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xFF",
"green" : "0xFF",
"red" : "0xFF"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xFF",
"green" : "0xFF",
"red" : "0xFF"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x17",
"green" : "0x15",
"red" : "0x10"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading