package com.cameleer.server.core.runtime;

import java.util.Set;

/**
 * Preset palette for the per-environment UI color indicator. Stored as a plain
 * lowercase string on {@link Environment#color()}. The eight values are
 * CHECK-constrained in PostgreSQL (V2 migration) and validated again here on
 * the write path so the controller can return a 400 with a readable message.
 *
 * <p>Unknown values are silently tolerated on read (the UI falls back to
 * {@link #DEFAULT}), so a manual DB tweak won't break rendering — but the API
 * refuses to persist anything outside this set.
 */
public final class EnvironmentColor {

    public static final String DEFAULT = "slate";

    public static final Set<String> VALUES = Set.of(
            "slate", "red", "amber", "green", "teal", "blue", "purple", "pink"
    );

    private EnvironmentColor() {}

    public static boolean isValid(String color) {
        return color != null && VALUES.contains(color);
    }
}
