<commit_before>const decToHex = decimal => decimal.toString(16);
const hexToDec = hex => parseInt(hex, 16);
const hasHashSym = color => color[0] === '#';

export default (inputColorA, inputColorB, weight = 50) => {
  const colorA = hasHashSym(inputColorA) ? inputColorA.slice(1) : inputColorA,
      colorB = hasHashSym(inputColorB) ? inputColorB.slice(1) : inputColorB;

  const colorAPairs = colorA.match(/.{1,2}/g), colorBPairs = colorB.match(/.{1,2}/g);
  const hex = colorAPairs.reduce((acc, pair, i) => {
    const val1 = hexToDec(pair), val2 = hexToDec(colorBPairs[i]);

    const combination = decToHex(Math.floor(val2 + (val1 - val2) * (weight / 100.0)));

    return acc + (combination.length < 2 ? `0${combination}` : combination);
  }, '').toUpperCase();

  return `#${hex}`;
};<commit_msg>use .replace to remove # from hashes<commit_after>const decToHex = decimal => decimal.toString(16);
const hexToDec = hex => parseInt(hex, 16);

export default (inputColorA, inputColorB, weight = 50) => {
  const colorA = inputColorA.replace(/#/, ''),
      colorB = inputColorB.replace(/#/, '');

  const colorAPairs = colorA.match(/.{1,2}/g), colorBPairs = colorB.match(/.{1,2}/g);
  const hex = colorAPairs.reduce((acc, pair, i) => {
    const val1 = hexToDec(pair), val2 = hexToDec(colorBPairs[i]);

    const combination = decToHex(Math.floor(val2 + (val1 - val2) * (weight / 100.0)));

    return acc + (combination.length < 2 ? `0${combination}` : combination);
  }, '').toUpperCase();

  return `#${hex}`;
};
{'fraction_non_alphanumeric': 0.18589321028345418, 'fraction_numerical': 0.02966381015161503, 'mean_word_length': 4.3076923076923075, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '4974547', 'n_tokens_mistral': 552, 'n_tokens_neox': 531, 'n_words': 115}