Skip to content

Commit

Permalink
Renamed colors
Browse files Browse the repository at this point in the history
  • Loading branch information
aromanov91 committed Nov 9, 2024
1 parent 4e825fa commit a334c18
Show file tree
Hide file tree
Showing 43 changed files with 210 additions and 210 deletions.
2 changes: 1 addition & 1 deletion Sources/OversizeUI/Controls/Avatar/Avatar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public struct Avatar: View {
var background: AvatarBackgroundType = .color(.surfaceSecondary)

/// Sets a custom text and image color for the Avatar.
var onBackgroundColor: Color = .onSurfaceMediumEmphasis
var onBackgroundColor: Color = .onSurfaceSecondary

/// Creates and initializes a Avatar
/// - Parameters:
Expand Down
8 changes: 4 additions & 4 deletions Sources/OversizeUI/Controls/Button/BarButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,17 @@ public struct BarButton: View {
case let .primary(text, _):
Text(text)
case .closeAction:
IconDeprecated(.xMini, color: .onSurfaceMediumEmphasis)
IconDeprecated(.xMini, color: .onSurfaceSecondary)
case .backAction:
IconDeprecated(.arrowLeft, color: .onSurfaceMediumEmphasis)
IconDeprecated(.arrowLeft, color: .onSurfaceSecondary)
case let .disabled(text):
Text(text)
case let .image(image, _):
image
.renderingMode(.template)
.onSurfaceHighEmphasisForegroundColor()
.onSurfacePrimaryForeground()
case let .icon(icon, _):
IconDeprecated(icon, color: .onSurfaceMediumEmphasis)
IconDeprecated(icon, color: .onSurfaceSecondary)
}
}
}
14 changes: 7 additions & 7 deletions Sources/OversizeUI/Controls/Button/Button.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public struct OversizeButtonStyle: ButtonStyle {
.opacity(backgroundOpacity))
.overlay {
Capsule()
.strokeBorder(Color.onSurfaceHighEmphasis.opacity(0.15), lineWidth: 2)
.strokeBorder(Color.onSurfacePrimary.opacity(0.15), lineWidth: 2)
.opacity(isBordered || theme.borderButtons ? 1 : 0)
}

Expand All @@ -66,7 +66,7 @@ public struct OversizeButtonStyle: ButtonStyle {
.opacity(backgroundOpacity))
.overlay {
RoundedRectangle(cornerRadius: radius != .medium ? radius.rawValue : theme.radius, style: .continuous)
.strokeBorder(Color.onSurfaceHighEmphasis.opacity(0.15), lineWidth: 2)
.strokeBorder(Color.onSurfacePrimary.opacity(0.15), lineWidth: 2)
.opacity(isBordered || theme.borderButtons ? 1 : 0)
}
}
Expand Down Expand Up @@ -100,10 +100,10 @@ public struct OversizeButtonStyle: ButtonStyle {
switch type {
case .primary:
switch role {
case .some(.destructive), .some(.cancel): Color.onPrimaryHighEmphasis
case .some(.destructive), .some(.cancel): Color.onPrimary
default:
if isAccent {
Color.onPrimaryHighEmphasis
Color.onPrimary
} else {
Color.backgroundPrimary
}
Expand All @@ -116,18 +116,18 @@ public struct OversizeButtonStyle: ButtonStyle {
if isAccent {
Color.accent
} else {
Color.onSurfaceHighEmphasis
Color.onSurfacePrimary
}
}
case .tertiary:
switch role {
case .some(.destructive): Color.error
case .some(.cancel): Color.onSurfaceHighEmphasis
case .some(.cancel): Color.onSurfacePrimary
default:
if isAccent {
Color.accent
} else {
Color.onSurfaceHighEmphasis
Color.onSurfacePrimary
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions Sources/OversizeUI/Controls/Checkbox/Checkbox.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public struct Checkbox<Label: View>: View {
private func checkboxImage(isEnabled: Bool, isOn: Bool) -> some View {
ZStack {
RoundedRectangle(cornerRadius: Radius.small, style: .continuous)
.strokeBorder(Color.onSurfaceDisabled.opacity(isEnabled ? 1 : 0.5), lineWidth: 2.5)
.strokeBorder(Color.onSurfaceTertiary.opacity(isEnabled ? 1 : 0.5), lineWidth: 2.5)
.frame(width: 24, height: 24)
.opacity(isOn ? 0 : 1)

Expand All @@ -87,16 +87,16 @@ public struct Checkbox<Label: View>: View {

Image(systemName: "checkmark")
.font(.caption.weight(.black))
.foregroundColor(.onPrimaryHighEmphasis.opacity(isEnabled ? 1 : 0.5))
.foregroundColor(.onPrimary.opacity(isEnabled ? 1 : 0.5))
.opacity(isOn ? 1 : 0)
}
}

private var foregroundColor: Color {
if isEnabled {
Color.onSurfaceHighEmphasis
Color.onSurfacePrimary
} else {
Color.onSurfaceDisabled
Color.onSurfaceTertiary
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/OversizeUI/Controls/GridSelect/GridSelect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public struct GridSelect<Element: Equatable, Content, Selection>: View

RoundedRectangle(cornerRadius: radius,
style: .continuous)
.strokeBorder(Color.onSurfaceMediumEmphasis, lineWidth: 2)
.strokeBorder(Color.onSurfaceSecondary, lineWidth: 2)
case .accentSurface:
RoundedRectangle(cornerRadius: radius.rawValue,
style: .continuous)
Expand Down Expand Up @@ -163,7 +163,7 @@ public struct GridSelect<Element: Equatable, Content, Selection>: View
Circle()
.foregroundColor(Color.surfacePrimary)
.shadowElevaton(.z2)
IconDeprecated(.checkMini, color: .onSurfaceHighEmphasis)
IconDeprecated(.checkMini, color: .onSurfacePrimary)
}.frame(width: Space.large.rawValue, height: Space.large.rawValue)
.padding(.small)
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/OversizeUI/Controls/HUD/HUD.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public struct HUD<Title, Icon>: View where Title: View, Icon: View {
Text(text)
.body(.medium)
#if os(macOS)
.foregroundColor(Color.onPrimaryHighEmphasis)
.foregroundColor(Color.onPrimary)
#else
.foregroundColor(Color.onSurfaceHighEmphasis)

Expand All @@ -62,7 +62,7 @@ public struct HUD<Title, Icon>: View where Title: View, Icon: View {
#if os(macOS)
.background(
RoundedRectangle(cornerRadius: .small, style: .continuous)
.foregroundColor(Color.onBackgroundHighEmphasis)
.foregroundColor(Color.onBackgroundPrimary)
.shadowElevaton(.z2)
)
#else
Expand Down
6 changes: 3 additions & 3 deletions Sources/OversizeUI/Controls/Label/MenuLabelStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ public struct MenuLabelStyle: LabelStyle {
HStack(spacing: .xSmall) {
configuration.icon
.headline()
.foregroundColor(.onSurfaceHighEmphasis)
.foregroundColor(.onSurfacePrimary)

VStack(alignment: textAlignment, spacing: .xxxSmall) {
configuration.title
.headline(.semibold)
.foregroundColor(.onSurfaceHighEmphasis)
.foregroundColor(.onSurfacePrimary)

if let subtitle, !subtitle.isEmpty {
Text(subtitle)
.subheadline()
.foregroundColor(.onSurfaceMediumEmphasis)
.foregroundColor(.onSurfaceSecondary)
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/OversizeUI/Controls/Label/RowLabelStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ public struct RowLabelStyle: LabelStyle {
HStack(spacing: .xSmall) {
configuration.icon
.headline()
.foregroundColor(.onSurfaceHighEmphasis)
.foregroundColor(.onSurfacePrimary)

VStack(alignment: textAlignment, spacing: .xxxSmall) {
configuration.title
.headline(.semibold)
.foregroundColor(.onSurfaceHighEmphasis)
.foregroundColor(.onSurfacePrimary)

if let subtitle, !subtitle.isEmpty {
Text(subtitle)
.subheadline()
.foregroundColor(.onSurfaceMediumEmphasis)
.foregroundColor(.onSurfaceSecondary)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/OversizeUI/Controls/Loader/LoaderOverlayView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public struct LoaderOverlayView: View {
if showText {
Text(text.isEmpty ? "Loading" : text)
.headline(.semibold)
.onSurfaceDisabledForegroundColor()
.onSurfaceTertiaryForeground()
.offset(y: 8)
}
}
Expand All @@ -74,7 +74,7 @@ public struct LoaderOverlayView: View {
if showText {
Text(text.isEmpty ? "Loading" : text)
.headline(.semibold)
.onSurfaceDisabledForegroundColor()
.onSurfaceTertiaryForeground()
.offset(y: 8)
}
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/OversizeUI/Controls/Menu/BarButtonMenuStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public struct BarButtonMenuStyle: MenuStyle {
public func makeBody(configuration: Configuration) -> some View {
Menu(configuration)
.body(true)
.foregroundColor(Color.onPrimaryHighEmphasis)
.foregroundColor(Color.onPrimary)
.padding(.xxSmall)
.background(background)
.shadowElevaton(.z2)
Expand All @@ -28,7 +28,7 @@ public struct BarButtonMenuStyle: MenuStyle {
.fill(Color.surfacePrimary)
.overlay {
Capsule()
.strokeBorder(Color.onSurfaceHighEmphasis.opacity(0.15), lineWidth: 2)
.strokeBorder(Color.onSurfacePrimary.opacity(0.15), lineWidth: 2)
.opacity(isBordered || theme.borderButtons ? 1 : 0)
}
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/OversizeUI/Controls/Notice/NoticeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ public struct NoticeView<A>: View where A: View {

Text(title)
.headline(.semibold)
.onSurfaceHighEmphasisForegroundColor()
.onSurfacePrimaryForeground()
.multilineTextAlignment(.leading)
.padding(.trailing, closeAction != nil ? .medium : .zero)
}

subtitle.map { text in
Text(text)
.body(.medium)
.onSurfaceMediumEmphasisForegroundColor()
.onSurfaceSecondaryForeground()
.multilineTextAlignment(.leading)
}

Expand Down
16 changes: 8 additions & 8 deletions Sources/OversizeUI/Controls/PageView/Page.swift
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public struct Page<Content, Header, LeadingBar, TrailingBar, TopToolbar, TitleLa
case .none:
EmptyView()
case .icon:
IconDeprecated(.xMini, color: .onSurfaceMediumEmphasis)
IconDeprecated(.xMini, color: .onSurfaceSecondary)
.background {
Circle()
.fill(Color.backgroundTertiary)
Expand All @@ -282,7 +282,7 @@ public struct Page<Content, Header, LeadingBar, TrailingBar, TopToolbar, TitleLa
case let .label(text):
Text(text)
.subheadline(.bold)
.foregroundColor(.onSurfaceHighEmphasis)
.foregroundColor(.onSurfacePrimary)
.padding(.horizontal, .xSmall)
.background {
RoundedRectangle(cornerRadius: .small, style: .continuous)
Expand Down Expand Up @@ -1055,11 +1055,11 @@ struct SeartchTextFieldStyle: TextFieldStyle {
HStack(spacing: .xxSmall) {
Image.Base.search
.renderingMode(.template)
.onSurfaceDisabledForegroundColor()
.onSurfaceTertiaryForeground()

configuration
}
.onSurfaceHighEmphasisForegroundColor()
.onSurfacePrimaryForeground()
.callout(.semibold)
.padding(.horizontal, 12)
.padding(.vertical, .xSmall)
Expand All @@ -1068,7 +1068,7 @@ struct SeartchTextFieldStyle: TextFieldStyle {
cornerRadius: .medium,
style: .continuous
)
.fill(Color.onSurfaceHighEmphasis.opacity(0.07))
.fill(Color.onSurfacePrimary.opacity(0.07))
)
.submitLabel(.search)
}
Expand All @@ -1087,11 +1087,11 @@ struct SeartchTextFieldButtonStyle: ButtonStyle {
HStack(spacing: .xxSmall) {
Image.Base.search
.renderingMode(.template)
.foregroundColor(Color.onSurfaceDisabled.opacity(height > 20 ? opacity : 0))
.foregroundColor(Color.onSurfaceTertiary.opacity(height > 20 ? opacity : 0))

configuration.label
.frame(maxWidth: .infinity, alignment: .leading)
.foregroundColor(Color.onSurfaceDisabled.opacity(height > 20 ? opacity : 0))
.foregroundColor(Color.onSurfaceTertiary.opacity(height > 20 ? opacity : 0))
}

.callout(.semibold)
Expand All @@ -1102,7 +1102,7 @@ struct SeartchTextFieldButtonStyle: ButtonStyle {
cornerRadius: .medium,
style: .continuous
)
.fill(Color.onSurfaceHighEmphasis.opacity(0.07))
.fill(Color.onSurfacePrimary.opacity(0.07))
)
.submitLabel(.search)
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/OversizeUI/Controls/Premium/PremiumLabel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ public struct PremiumLabel: View {
if let image {
image
.renderingMode(.template)
.foregroundColor(isMonohrom ? Color(red: 0.718, green: 0.325, blue: 0.459) : .onPrimaryHighEmphasis)
.foregroundColor(isMonohrom ? Color(red: 0.718, green: 0.325, blue: 0.459) : .onPrimary)
}
Text(text)
.font(.system(size: fontSize, weight: .heavy))
.foregroundColor(isMonohrom ? Color(red: 0.718, green: 0.325, blue: 0.459) : .onPrimaryHighEmphasis)
.foregroundColor(isMonohrom ? Color(red: 0.718, green: 0.325, blue: 0.459) : .onPrimary)
}
.padding(.leading, leadingPadding)
.padding(.trailing, trailingPadding)
Expand All @@ -47,7 +47,7 @@ public struct PremiumLabel: View {
Group {
if isMonohrom {
RoundedRectangle(cornerRadius: radius, style: .continuous)
.fill(Color.onPrimaryHighEmphasis)
.fill(Color.onPrimary)
} else {
RoundedRectangle(cornerRadius: radius, style: .continuous)
.fill(LinearGradient(gradient: Gradient(colors: [
Expand Down
6 changes: 3 additions & 3 deletions Sources/OversizeUI/Controls/Radio/Radio.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public struct Radio<Label: View>: View {
private func radioImage(isEnabled: Bool, isOn: Bool) -> some View {
ZStack {
Circle()
.stroke(Color.onSurfaceDisabled.opacity(isEnabled ? 1 : 0.5), lineWidth: 4)
.stroke(Color.onSurfaceTertiary.opacity(isEnabled ? 1 : 0.5), lineWidth: 4)
.frame(width: 24, height: 24)
.cornerRadius(12)
.opacity(isOn ? 0 : 1)
Expand All @@ -100,9 +100,9 @@ public struct Radio<Label: View>: View {

private var foregroundColor: Color {
if isEnabled {
Color.onSurfaceHighEmphasis
Color.onSurfacePrimary
} else {
Color.onSurfaceDisabled
Color.onSurfaceTertiary
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions Sources/OversizeUI/Controls/Row/Row.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public struct Row<LeadingLabel, TrailingLabel>: View where LeadingLabel: View, T

if isShowArrowIcon {
Image.Base.chevronRight
.icon(.onSurfaceDisabled)
.icon(.onSurfaceTertiary)
}
}
}
Expand Down Expand Up @@ -160,7 +160,7 @@ public struct Row<LeadingLabel, TrailingLabel>: View where LeadingLabel: View, T
сlearAction?()
} label: {
ZStack {
IconDeprecated(.xMini, color: .onSurfaceDisabled)
IconDeprecated(.xMini, color: .onSurfaceTertiary)
.background(
RoundedRectangle(cornerRadius: .small, style: .continuous)
.fillSurfaceSecondary()
Expand All @@ -183,15 +183,15 @@ public struct Row<LeadingLabel, TrailingLabel>: View where LeadingLabel: View, T
if let textColor {
textColor
} else {
Color.onSurfaceHighEmphasis
Color.onSurfacePrimary
}
}

private var subtitleTextColor: Color {
if let textColor {
textColor
} else {
Color.onSurfaceMediumEmphasis
Color.onSurfaceSecondary
}
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/OversizeUI/Controls/Row/RowButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ public struct RowButton: View {
? Color.link
: style == .delete
? Color.error
: Color.onSurfaceHighEmphasis
: Color.onSurfacePrimary
}
}
Loading

0 comments on commit a334c18

Please sign in to comment.