Skip to content

Commit

Permalink
Merge pull request #5 from antonmartinsson/bug-fix
Browse files Browse the repository at this point in the history
Fix color modifier bug
  • Loading branch information
antonmartinsson authored Jan 28, 2023
2 parents ae1aa80 + a0f1b8f commit d0ff486
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sources/GaugeKit/GaugeLabelStack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import SwiftUI
- title: A title to be displayed below the value.
*/
struct GaugeLabelStack: View {
@Environment(\.valueLabelColor) var labelColor
@Environment(\.valueLabelColor) var valueColor
@Environment(\.titleLabelColor) var titleColor

var value: Int?
Expand All @@ -30,13 +30,15 @@ struct GaugeLabelStack: View {
VStack {
if let unwrappedValue = value {
Text("\(unwrappedValue)")
.font(.system(size: smallestDimension / 4))
.fontWeight(.bold)
.font(.system(size: smallestDimension / 4))
.foregroundColor(valueColor)
}
if let unwrappedTitle = title {
Text(unwrappedTitle)
.fontWeight(.light)
.font(.system(size: smallestDimension / 20))
.foregroundColor(titleColor)
}
}
.position(x: geometry.size.width / 2, y: geometry.size.height / 2)
Expand Down

0 comments on commit d0ff486

Please sign in to comment.