import {
  ACCENT_HUE,
  brandRamp,
  NEGATIVE_HUE,
  NEUTRAL_HUE,
  neutralEnds,
  neutralRamp,
  POSITIVE_HUE,
  prefixRamp,
  reverseRamp,
} from './color-generation'
import type {Palette} from './types'

const shared = {
  white: '#ffffff',
  black: '#000000',
}

const gray = neutralRamp(NEUTRAL_HUE)
const ends = neutralEnds(NEUTRAL_HUE)
const primary = brandRamp(ACCENT_HUE, 60)
const positive = brandRamp(POSITIVE_HUE, 70)
const negative = brandRamp(NEGATIVE_HUE, 75)

export const lightPalette: Palette = {
  ...shared,
  bg: gray[25],
  bg_hard: ends.lightest,
  ...prefixRamp('contrast', gray),
  ...prefixRamp('primary', primary),
  ...prefixRamp('positive', positive),
  ...prefixRamp('negative', negative),
} as Palette

export const darkPalette: Palette = {
  ...shared,
  bg: gray[975],
  bg_hard: ends.darkest,
  ...prefixRamp('contrast', reverseRamp(gray)),
  ...prefixRamp('primary', reverseRamp(primary)),
  ...prefixRamp('positive', reverseRamp(positive)),
  ...prefixRamp('negative', reverseRamp(negative)),
} as Palette
