class ColorCalculator {
    constructor() {
        // Available color families from our palette
        this.colorFamilies = ['sand', 'pink', 'red', 'rust', 'clay', 'gold', 'moss', 'pine', 'cyan', 'blue'];
        // Available shades for each color
        this.shades = ['100', '500', '900'];
    }

    // Get color based on sigil digit and influences
    getColor(sigilDigit, influences = []) {
        // Map digit 0-9 to color family
        const colorFamily = this.colorFamilies[sigilDigit];
        
        // Calculate shade based on influences
        const shade = this.calculateShade(influences);
        
        return `${colorFamily}-${shade}`;
    }

    // Calculate shade based on surrounding influences
    calculateShade(influences) {
        if (!influences.length) return '500';
        
        // Average the influences and map to one of our three shades
        const avg = influences.reduce((sum, val) => sum + val, 0) / influences.length;
        if (avg < 3) return '100';
        if (avg > 6) return '900';
        return '500';
    }
}