{"size": 672, "ext": "js", "max_stars_repo_path": "src/utils/getIntervalColor.js", "max_stars_repo_name": "rkhitin/pomidoro-timer", "max_stars_repo_stars_event_min_datetime": "2018-01-12T06:33:58.000Z", "max_stars_repo_stars_event_max_datetime": "2020-06-15T15:48:20.000Z", "max_issues_repo_path": "src/utils/getIntervalColor.js", "max_issues_repo_name": "rkhitin/pomidoro-timer", "max_issues_repo_issues_event_min_datetime": "2017-11-27T20:15:38.000Z", "max_issues_repo_issues_event_max_datetime": "2018-01-22T18:37:34.000Z", "max_forks_repo_path": "src/utils/getIntervalColor.js", "max_forks_repo_name": "rkhitin/pomidoro-timer", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 3, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 20.3636363636, "max_line_length": 46, "alphanum_fraction": 0.6324404762}
// @flow
import intervals from '../constants/intervals'
import colors from '../constants/colors'

export default function getIntervalColor(
  type: Interval,
  isItBackground: boolean
): string {
  if (isItBackground) {
    switch (type) {
      case intervals.work:
        return colors.red
      case intervals.smallBreak:
        return colors.green
      case intervals.bigBreak:
        return colors.green
      default:
        return 'grey'
    }
  }

  switch (type) {
    case intervals.work:
      return '#c7c7c7'
    case intervals.smallBreak:
      return '#a2a2a2'
    case intervals.bigBreak:
      return '#a2a2a2'
    default:
      return 'grey'
  }
}
