{"size": 1508, "ext": "js", "max_stars_repo_path": "src/Util.js", "max_stars_repo_name": "gsass1/AlgoVis", "max_stars_repo_stars_event_min_datetime": "2021-03-26T20:48:17.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-26T20:48:17.000Z", "max_issues_repo_path": "src/Util.js", "max_issues_repo_name": "Nuke928/AlgoVis", "max_issues_repo_issues_event_min_datetime": "2021-03-09T10:32:51.000Z", "max_issues_repo_issues_event_max_datetime": "2021-10-06T01:26:57.000Z", "max_forks_repo_path": "src/Util.js", "max_forks_repo_name": "gsass1/AlgoVis", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 21.8550724638, "max_line_length": 88, "alphanum_fraction": 0.4728116711}
const lerpf = (a, b, t) => {
  return ((a) + ((b) - (a)) * (t));
};

const defaultFontStack = ["Liberation Mono", "Inconsolata"]
  .map((x) => { return `\"${x}\"`; })
  .join(",");

export default {
  lerpf,
  smoothstep: (a) => {
    return ((a) * (a) * (3.0 - 2.0 * (a)));
  },
  lerpColor: (a, b, t) => {
    return {
      r: lerpf(a.r, b.r, t),
      g: lerpf(a.g, b.g, t),
      b: lerpf(a.b, b.b, t),
    }
  },
  colorToCSS: (color) => {
    return `rgb(${Math.floor(color.r)}, ${Math.floor(color.g)}, ${Math.floor(color.b)})`
  },
  randomColor: () => {
    return {
      r: Math.floor(Math.random()*255),
      g: Math.floor(Math.random()*255),
      b: Math.floor(Math.random()*255),
    }
  },
  randomColorLower: () => {
    return {
      r: Math.floor(Math.random()*64),
      g: Math.floor(Math.random()*64),
      b: Math.floor(Math.random()*128),
    }
  },
  randomColorUpper: () => {
    return {
      r: Math.floor(Math.random()*128)+127,
      g: Math.floor(Math.random()*128)+127,
      b: Math.floor(Math.random()*128)+127,
    }
  },
  cssFont: (size, font) => {
    return size + "px " + font;
  },
  defaultFont: (size) => {
    return size + "px " + defaultFontStack;
  },
  clamp: (value, min, max) => {
    return Math.min(Math.max(value, min), max);
  },
  invertColor: (c) => {
    return {
      r: 255 - c.r,
      g: 255 - c.g,
      b: 255 - c.b
    };
  },
  shadeColor: (c) => {
    return {
      r: c.r * 0.75,
      g: c.g * 0.75,
      b: c.b * 0.75
    };
  }
};
