//
//  ColorUtils.swift
//  TheNoiseClock
//
//  Created by Matt Bruce on 9/7/25.
//

import SwiftUI

/// Color manipulation utilities
enum ColorUtils {
    
    /// Calculate glow radius based on intensity
    /// - Parameter intensity: Glow intensity (0.0 to 1.0)
    /// - Returns: Blur radius for glow effect
    static func glowRadius(intensity: Double) -> CGFloat {
        return CGFloat(20 * intensity)
    }
    
    /// Calculate glow opacity based on intensity
    /// - Parameter intensity: Glow intensity (0.0 to 1.0)
    /// - Returns: Opacity for glow effect
    static func glowOpacity(intensity: Double) -> Double {
        return min(0.9, max(0, intensity))
    }
    
    /// Clamp opacity value to valid range
    /// - Parameter opacity: Opacity value to clamp
    /// - Returns: Clamped opacity (0.0 to 1.0)
    static func clampOpacity(_ opacity: Double) -> Double {
        return max(0.0, min(opacity, 1.0))
    }
    
}
