using UnityEngine;

public class ColorPalette : Singleton<ColorPalette> {
    public static string redHex = "#e26d6d";
    public static string blueHex = "#5bc6d3";
    public static string greenHex = "#c1d253";

    public Color _red;
    public Color _blue;
    public Color _green;

    public static Color red { get { return Instance._red; } }
    public static Color blue { get { return Instance._blue; } }
    public static Color green { get { return Instance._green; } }

    void Awake() {
        initialize();
    }

    private void initialize() {
        _red = getColor(redHex);
        _blue = getColor(blueHex);
        _green = getColor(greenHex);
    }

    public Color getColor(string value) {
        Color c;
        ColorUtility.TryParseHtmlString(value, out c);
        return c;
    }

    public static Color getColorFromString(string color) {
        switch (color) {
            case "red": return red;
            case "blue": return blue;
            case "green": return green;
            default: return Color.white;
        }
    }
}