<commit_before>Rickshaw.namespace("Rickshaw.Color.Palette");

Rickshaw.Color.Palette = function(args) {

	var color = new Rickshaw.Fixtures.Color();

	args = args || {};
	this.schemes = {};

	this.scheme = color.schemes[args.scheme] || args.scheme || color.schemes.colorwheel;
	this.runningIndex = 0;

	this.color = function(key) {
		return this.scheme[key] || this.scheme[this.runningIndex++] || '#808080';
	};
};<commit_msg>add color interpolation to get more colors than your colorscheme specifies, but still in the same general range<commit_after>Rickshaw.namespace("Rickshaw.Color.Palette");

Rickshaw.Color.Palette = function(args) {

	var color = new Rickshaw.Fixtures.Color();

	args = args || {};
	this.schemes = {};

	this.scheme = color.schemes[args.scheme] || args.scheme || color.schemes.colorwheel;
	this.runningIndex = 0;
	this.generatorIndex = 0;
  this.rotateCount = this.scheme.length;

	this.color = function(key) {
		return this.scheme[key] || this.scheme[this.runningIndex++] || this.interpolateColor() || '#808080';
	};

  this.interpolateColor = function() {
    var color;
    if (this.generatorIndex == this.rotateCount * 2 - 1) {
      color = d3.interpolateHsl(this.scheme[this.generatorIndex], this.scheme[0])(0.5);
      this.generatorIndex = 0;
      this.rotateCount *= 2;
    } else {
      color = d3.interpolateHsl(this.scheme[this.generatorIndex], this.scheme[this.generatorIndex + 1])(0.5);
      this.generatorIndex++;
    }
    this.scheme.push(color);
    return color;
  };

};
{'fraction_non_alphanumeric': 0.15754779169413316, 'fraction_numerical': 0.017798286090969017, 'mean_word_length': 4.093959731543624, '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': '4989818', 'n_tokens_mistral': 537, 'n_tokens_neox': 501, 'n_words': 91}