Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit eb915e3

Browse files
authored
Add Opacity constants and consolidate hardcoded opacity values
1 parent ed5a788 commit eb915e3

20 files changed

Lines changed: 93 additions & 36 deletions

File tree

Features/InAppNotifications/Sources/ViewModels/InAppNotificationListItemViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public struct InAppNotificationListItemViewModel: Identifiable, Sendable {
2525
ListItemModel(
2626
title: item.title,
2727
titleTag: isRead ? nil : Localized.Assets.Tags.new,
28-
titleTagStyle: TextStyle(font: .footnote.weight(.medium), color: .blue, background: Colors.blue.opacity(0.15)),
28+
titleTagStyle: TextStyle(font: .footnote.weight(.medium), color: .blue, background: Colors.blue.opacity(.light)),
2929
titleExtra: item.subtitle,
3030
subtitle: item.value,
3131
subtitleStyle: TextStyle(font: .callout, color: Colors.black, fontWeight: .semibold),

Features/Onboarding/Sources/ViewModels/TermItemViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Style
66
final class TermItemViewModel: Identifiable {
77
let message: String
88
var style: TextStyle {
9-
isConfirmed ? .body : TextStyle(font: .body, color: Colors.black.opacity(0.8))
9+
isConfirmed ? .body : TextStyle(font: .body, color: Colors.black.opacity(.strong))
1010
}
1111
var isConfirmed: Bool = false
1212

Features/Perpetuals/Sources/Types/ChartGridStyle.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import Charts
55
import Style
66

77
struct ChartGridStyle {
8-
static let opacity: Double = 0.13
98
static let lineWidth: CGFloat = 1
109
static let dash: [CGFloat] = [4, 4]
1110
static let strokeStyle = StrokeStyle(lineWidth: lineWidth, dash: dash)
12-
static let color = Colors.gray.opacity(opacity)
11+
static let color = Colors.gray.opacity(.opacity13)
1312
}

Features/Perpetuals/Sources/Views/CandleTooltipView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ struct CandleTooltipView: View {
2626
.clipShape(RoundedRectangle(cornerRadius: Spacing.small))
2727
.overlay(
2828
RoundedRectangle(cornerRadius: Spacing.small)
29-
.stroke(Colors.black.opacity(0.08), lineWidth: 1)
29+
.stroke(Colors.black.opacity(.opacity8), lineWidth: 1)
3030
)
31-
.shadow(color: .black.opacity(0.12), radius: Spacing.small, y: Spacing.tiny)
31+
.shadow(color: .black.opacity(.opacity12), radius: Spacing.small, y: Spacing.tiny)
3232
.fixedSize()
3333
}
3434
}

Features/Perpetuals/Sources/Views/CandlestickChartView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ struct CandlestickChartView: View {
166166
private func linesMarks(_ bounds: ChartBounds) -> some ChartContent {
167167
ForEach(bounds.visibleLines) { line in
168168
RuleMark(y: .value(ChartKey.price, line.price))
169-
.foregroundStyle(line.color.opacity(0.6))
169+
.foregroundStyle(line.color.opacity(.semiStrong))
170170
.lineStyle(line.lineStyle)
171171
}
172172

Features/Settings/Sources/ChainSettings/ViewModels/LatencyViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ struct LatencyViewModel: Sendable {
2626
}
2727

2828
var background: Color {
29-
color.opacity(0.15)
29+
color.opacity(.light)
3030
}
3131

3232
var value: Int {

Features/Settings/Sources/ChainSettings/ViewModels/NodeStatusStateViewModel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ struct NodeStatusStateViewModel: Sendable {
4242

4343
public var background: Color {
4444
switch nodeStatus {
45-
case .error: Colors.red.opacity(0.15)
45+
case .error: Colors.red.opacity(.light)
4646
case .none: .clear
4747
case .result(let nodeStatus):
48-
nodeStatus.latestBlockNumber.isZero ? Colors.red.opacity(0.15) : LatencyViewModel(latency: nodeStatus.latency).background
48+
nodeStatus.latestBlockNumber.isZero ? Colors.red.opacity(.light) : LatencyViewModel(latency: nodeStatus.latency).background
4949
}
5050
}
5151
}

Features/Transfer/Sources/Scenes/ReceiveScene.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public struct ReceiveScene: View {
4343
.background(
4444
RoundedRectangle(cornerRadius: .medium)
4545
.fill(Colors.listStyleColor)
46-
.shadow(color: Color.black.opacity(Sizing.shadow.opacity), radius: Sizing.shadow.radius, x: .zero, y: Sizing.shadow.yOffset)
46+
.shadow(color: Color.black.opacity(.opacity25), radius: Sizing.shadow.radius, x: .zero, y: Sizing.shadow.yOffset)
4747
)
4848
}
4949
Text(model.warningMessage)

Packages/Components/Sources/Buttons/RoundButton.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public struct RoundButton: View {
3232
.frame(size: 48)
3333
.background(Colors.blue)
3434
.clipShape(Circle())
35-
.opacity(isEnabled ? 1 : 0.5)
35+
.opacity(isEnabled ? 1 : .medium)
3636
.liquidGlass()
3737
Text(title)
3838
.allowsTightening(true)

Packages/Components/Sources/NftImageView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public struct NftImageView: View {
4242
if let type = assetImage.type {
4343
Text(type)
4444
.font(.body)
45-
.foregroundStyle(Colors.black.opacity(0.8))
45+
.foregroundStyle(Colors.black.opacity(.strong))
4646
.padding(.small)
4747
}
4848
}

0 commit comments

Comments
 (0)