<commit_before>/**
 * Created by Islam on 09.12.2016.
 */

module.exports = {
	getAvgColor: function(canvas){
		if(!canvas.getImageData) return null;
		var data = canvas.getImageData(0, 0, canvas.width, canvas.height),
			r = 0, g = 0, b = 0, a = 0, n = 0;
		for(var i = 0; i < data.length - 3; i+=4){
			n++;
			r += data[i];
			g += data[i+1];
			b += data[i+2];
			a += data[i+3];
		}
		return {
			r: r / n,
			g: g / n,
			b: b / n,
			a: a / n
		}
	}
};<commit_msg>getAvgColor fixed<commit_after>/**
 * Created by Islam on 09.12.2016.
 */

module.exports = {
	getAvgColor: function(canvas){
		var ctx = canvas.getContext('2d');
		if(!ctx.getImageData) return null;
		var data = ctx.getImageData(0, 0, canvas.width, canvas.height),
			r = 0, g = 0, b = 0, a = 0, n = 0;
		for(var i = 0; i < data.length - 3; i+=4){
			n++;
			r += data[i];
			g += data[i+1];
			b += data[i+2];
			a += data[i+3];
		}
		return {
			r: r / n,
			g: g / n,
			b: b / n,
			a: a / n
		}
	}
};
{'fraction_non_alphanumeric': 0.20777891504605936, 'fraction_numerical': 0.044012282497441144, 'mean_word_length': 2.270903010033445, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5473961', 'n_tokens_mistral': 514, 'n_tokens_neox': 433, 'n_words': 118}