<commit_before>import { IColorSet, IBaseColorSet } from './interfaces';

function getRgb(color: string): [number, number, number] {
  return [
    parseInt(color.substr(1, 2), 16),
    parseInt(color.substr(3, 2), 16),
    parseInt(color.substr(5, 2), 16)
  ]
}

function toCssString(rgb: [number, number, number]): string {
  let result = '#';
  result += (rgb[0].toString(16).length === 1 ? '0' : '') + rgb[0].toString(16);
  result += (rgb[1].toString(16).length === 1 ? '0' : '') + rgb[1].toString(16);
  result += (rgb[2].toString(16).length === 1 ? '0' : '') + rgb[2].toString(16);
  return result;
}

export function lighten(color: string, amount: number): string {
  const MAX = 255;
  let r = parseInt(color.substr(1, 2), 16);
  let g = parseInt(color.substr(3, 2), 16);
  let b = parseInt(color.substr(5, 2), 16);
  r = Math.min(Math.floor(r + (r * amount)), MAX);
  g = Math.min(Math.floor(g + (g * amount)), MAX);
  b = Math.min(Math.floor(b + (b * amount)), MAX);
  return toCssString([r, g, b]);
}

export function darken(color: string, amount: number): string {<commit_msg>Adding missing semi-colon in src/color.ts ln:8<commit_after>import { IColorSet, IBaseColorSet } from './interfaces';

function getRgb(color: string): [number, number, number] {
  return [
    parseInt(color.substr(1, 2), 16),
    parseInt(color.substr(3, 2), 16),
    parseInt(color.substr(5, 2), 16)
  ];
}

function toCssString(rgb: [number, number, number]): string {
  let result = '#';
  result += (rgb[0].toString(16).length === 1 ? '0' : '') + rgb[0].toString(16);
  result += (rgb[1].toString(16).length === 1 ? '0' : '') + rgb[1].toString(16);
  result += (rgb[2].toString(16).length === 1 ? '0' : '') + rgb[2].toString(16);
  return result;
}

export function lighten(color: string, amount: number): string {
  const MAX = 255;
  let r = parseInt(color.substr(1, 2), 16);
  let g = parseInt(color.substr(3, 2), 16);
  let b = parseInt(color.substr(5, 2), 16);
  r = Math.min(Math.floor(r + (r * amount)), MAX);
  g = Math.min(Math.floor(g + (g * amount)), MAX);
  b = Math.min(Math.floor(b + (b * amount)), MAX);
  return toCssString([r, g, b]);
}

export function darken(color: string, amount: number): string {
{'fraction_non_alphanumeric': 0.21040723981900453, 'fraction_numerical': 0.04660633484162896, 'mean_word_length': 4.177985948477752, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1010453', 'n_tokens_mistral': 866, 'n_tokens_neox': 807, 'n_words': 199}