import { View } from 'react-native'; import { ThemedText } from '@/components/ThemedText'; import { colors } from '@/theme/colors'; import { spacing } from '@/theme/spacing'; import { valueToColor } from '@/utils/colorMap'; type LegendStop = { label: string; color: string; }; const LEGEND_STOPS: LegendStop[] = [ { label: 'Quiet', color: colorToRgba(0) }, { label: 'Low', color: colorToRgba(0.25) }, { label: 'Medium', color: colorToRgba(0.5) }, { label: 'High', color: colorToRgba(0.75) }, { label: 'Active', color: colorToRgba(1) }, ]; function colorToRgba(value: number): string { const [r, g, b] = valueToColor(value); return `rgba(${Math.round(r * 255)}, ${Math.round(g * 255)}, ${Math.round(b * 255)}, 1)`; } export const ZoneLegend = () => { return ( {LEGEND_STOPS.map((stop) => ( {stop.label} ))} ); };