Neu 🔸
針對這裡的「新擬物風格」所設計的相關顏色、漸層,讓我們在使用的時候更精確。
Last updated
Was this helpful?
針對這裡的「新擬物風格」所設計的相關顏色、漸層,讓我們在使用的時候更精確。
Last updated
Was this helpful?
import SwiftUI
import Palettes // for Gradeint ext
// colors & gradients for Neumorphic design
public enum Neu {
// colors
public enum color {
public static let cardBackground = Color(red: 0.878, green: 0.918, blue: 0.957)
public static let text = Color(red: 0.192, green: 0.212, blue: 0.329)
public static let iconShadow = Color(red: 0.565, green: 0.608, blue: 0.667)
public static let gray = Color(red: 0.592, green: 0.651, blue: 0.710)
public static let grayLight = Color(red: 0.812, green: 0.851, blue: 0.890)
public static let white = Color(red: 0.929, green: 0.949, blue: 0.973)
}
// color sets
public enum colors {
/// white, transparent white, gray shadow (for progress bar)
public static let groove = [
color.iconShadow,
Color.white.opacity(0.0), // ⭐️ 注意:這個會透出底色。
Color.white
]
/// shadow gray, dark (for icon images)
public static let icon = [color.iconShadow, color.text ]
/// white, gray (for card's rim)
public static let cardRim = [color.white, color.gray]
/// white, light gray (for ButtonUp background)
public static let buttonUpIconBackground = [color.white, color.grayLight]
}
// gradients -----------------
/// progress bar groove
public static let progressBarGroove = Gradient.down(colors.groove)
/// card icon
public static let cardIcon = Gradient.right(colors.icon)
/// card rim
public static let cardRim = Gradient.linear(
from : .init(x: -0.2, y: 0.5),
to : .bottomTrailing,
colors: colors.cardRim
)
/// ButtonDown icon
public static let buttonDownIcon = Gradient.left(colors.icon)
/// ButtonDown inner shadow
public static let buttonDownShadow = Gradient.linear(
from : .init(x: 0.2, y: 0.2),
to : .bottomTrailing,
colors: colors.buttonUpIconBackground
)
/// ButtonUp icon background
public static let buttonUpIconBackground = Gradient.right(colors.buttonUpIconBackground)
}