Neu ๐Ÿ”ธ

้‡ๅฐ้€™่ฃก็š„ใ€Œๆ–ฐๆ“ฌ็‰ฉ้ขจๆ ผใ€ๆ‰€่จญ่จˆ็š„็›ธ้—œ้ก่‰ฒใ€ๆผธๅฑค๏ผŒ่ฎ“ๆˆ‘ๅ€‘ๅœจไฝฟ็”จ็š„ๆ™‚ๅ€™ๆ›ด็ฒพ็ขบใ€‚

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)
    
}

Last updated