Skip to content

Commit 0bec5b1

Browse files
add cotrast colors as UniversalColor extensions
1 parent 87d7175 commit 0bec5b1

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Sources/ComponentsKit/Theme/Palette.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,14 @@ extension UniversalColor {
199199
public static var primary: Self {
200200
return Theme.current.colors.primary.main
201201
}
202+
/// The primary background color.
203+
public static var primaryBackground: Self {
204+
return Theme.current.colors.primary.background
205+
}
206+
/// The primary contrast color.
207+
public static var primaryContrast: Self {
208+
return Theme.current.colors.primary.contrast
209+
}
202210
/// The accent color.
203211
public static var accent: Self {
204212
return Theme.current.colors.accent.main
@@ -207,6 +215,10 @@ extension UniversalColor {
207215
public static var accentBackground: Self {
208216
return Theme.current.colors.accent.background
209217
}
218+
/// The accent contrast color.
219+
public static var accentContrast: Self {
220+
return Theme.current.colors.accent.contrast
221+
}
210222
/// The success state color, used for indicating positive actions or statuses.
211223
public static var success: Self {
212224
return Theme.current.colors.success.main
@@ -215,6 +227,10 @@ extension UniversalColor {
215227
public static var successBackground: Self {
216228
return Theme.current.colors.success.background
217229
}
230+
/// The success contrast color.
231+
public static var successContrast: Self {
232+
return Theme.current.colors.success.contrast
233+
}
218234
/// The warning state color, used for indicating caution or non-critical alerts.
219235
public static var warning: Self {
220236
return Theme.current.colors.warning.main
@@ -223,6 +239,10 @@ extension UniversalColor {
223239
public static var warningBackground: Self {
224240
return Theme.current.colors.warning.background
225241
}
242+
/// The warning contrast color.
243+
public static var warningContrast: Self {
244+
return Theme.current.colors.warning.contrast
245+
}
226246
/// The danger state color, used for indicating errors, destructive actions, or critical alerts.
227247
public static var danger: Self {
228248
return Theme.current.colors.danger.main
@@ -231,4 +251,8 @@ extension UniversalColor {
231251
public static var dangerBackground: Self {
232252
return Theme.current.colors.danger.background
233253
}
254+
/// The danger contrast color.
255+
public static var dangerContrast: Self {
256+
return Theme.current.colors.danger.contrast
257+
}
234258
}

0 commit comments

Comments
 (0)