diff options
Diffstat (limited to 'ios/MullvadVPN/Extensions')
| -rw-r--r-- | ios/MullvadVPN/Extensions/Color+Helpers.swift | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ios/MullvadVPN/Extensions/Color+Helpers.swift b/ios/MullvadVPN/Extensions/Color+Helpers.swift new file mode 100644 index 0000000000..89c886fc24 --- /dev/null +++ b/ios/MullvadVPN/Extensions/Color+Helpers.swift @@ -0,0 +1,16 @@ +// +// Color.swift +// MullvadVPN +// +// Created by Jon Petersson on 2024-12-06. +// Copyright © 2024 Mullvad VPN AB. All rights reserved. +// + +import SwiftUI + +extension Color { + /// Returns the color darker by the given percent (in range from 0..1) + func darkened(by percent: CGFloat) -> Color? { + UIColor(self).darkened(by: percent)?.color + } +} |
