import type { SegmentLabelColor } from '../types/timeline';

export type SegmentLabelTone = 'endpoint' | 'accent' | 'neutral';

/** Maps segment label color spec to SCSS tone classes. */
export function segmentLabelTone(
  color: SegmentLabelColor,
  posPx: number,
): SegmentLabelTone {
  if (color === 'fixed-accent') return 'endpoint';
  if (color === 'fixed-neutral') return 'neutral';
  return posPx >= color.dynamic ? 'accent' : 'neutral';
}
