<commit_before>var oneDegree = Math.PI / 180;
var rotX = new THREE.Matrix4().makeRotationFromEuler(new THREE.Euler(Math.PI * -.25, 0, 0));
var rotZ = new THREE.Matrix4().makeRotationFromEuler(new THREE.Euler(0, 0, Math.PI * -.30411));
var rgbToHslMatrix = new THREE.Matrix4().multiply(rotZ).multiply(rotX);
var hslToRgbMatrix = new THREE.Matrix4().getInverse(rgbToHslMatrix);
var littleHueLeftMatrix = new THREE.Matrix4().makeRotationFromEuler(new THREE.Euler(oneDegree*2, 0, 0));
var littleHueRightMatrix = new THREE.Matrix4().getInverse(littleHueLeftMatrix);
var littleSatMatrix = new THREE.Matrix4().makeScale(1, 1.01, 1.01);
var littleDesatMatrix = new THREE.Matrix4().getInverse(littleSatMatrix);
var littleBrighterMatrix = new THREE.Matrix4().makeTranslation(.01, 0, 0);
var littleDarkerMatrix = new THREE.Matrix4().getInverse(littleBrighterMatrix);


function Color3D() {
	if(arguments.length == 0) THREE.Color.call(this, 0xffffff);
	if(arguments.length == 1) THREE.Color.call(this, arguments[0]);
	if(arguments.length == 3) THREE.Color.call(this, arguments[0], arguments[1], arguments[2]);
	this.rgb = new THREE.Vector3(this.r, this.g, this.b);
	this.hsl = this.rgb.clone().applyMatrix4(rgbToHslMatrix);
}

Color3D.prototype = Object.create( THREE.Color.prototype );

Color3D.prototype.getHue = function() {
	return (-Math.atan2(
		this.hsl.y,
		this.hsl.z
	) + Math.PI * 1.5) % (Math.PI * 2);
}
Color3D.prototype.getSat = function() {
	return Math.sqrt(Math.pow(this.hsl.y, 2) + Math.pow(this.hsl.z, 2));
}
Color3D.prototype.getVal = function() {
	return this.hsl.x / 1.72;
}

Color3D.prototype.setHue = function(val) {<commit_msg>added perception-weighted brightness value<commit_after>var oneDegree = Math.PI / 180;
var rotX = new THREE.Matrix4().makeRotationFromEuler(new THREE.Euler(Math.PI * -.25, 0, 0));
var rotZ = new THREE.Matrix4().makeRotationFromEuler(new THREE.Euler(0, 0, Math.PI * -.30411));
var rgbToHslMatrix = new THREE.Matrix4().multiply(rotZ).multiply(rotX);
var hslToRgbMatrix = new THREE.Matrix4().getInverse(rgbToHslMatrix);
var littleHueLeftMatrix = new THREE.Matrix4().makeRotationFromEuler(new THREE.Euler(oneDegree*2, 0, 0));
var littleHueRightMatrix = new THREE.Matrix4().getInverse(littleHueLeftMatrix);
var littleSatMatrix = new THREE.Matrix4().makeScale(1, 1.01, 1.01);
var littleDesatMatrix = new THREE.Matrix4().getInverse(littleSatMatrix);
var littleBrighterMatrix = new THREE.Matrix4().makeTranslation(.01, 0, 0);
var littleDarkerMatrix = new THREE.Matrix4().getInverse(littleBrighterMatrix);


function Color3D() {
	if(arguments.length == 0) THREE.Color.call(this, 0xffffff);
	if(arguments.length == 1) THREE.Color.call(this, arguments[0]);
	if(arguments.length == 3) THREE.Color.call(this, arguments[0], arguments[1], arguments[2]);
	this.rgb = new THREE.Vector3(this.r, this.g, this.b);
	this.hsl = this.rgb.clone().applyMatrix4(rgbToHslMatrix);
}

Color3D.prototype = Object.create( THREE.Color.prototype );

Color3D.prototype.getHue = function() {
	return (-Math.atan2(
		this.hsl.y,
		this.hsl.z
	) + Math.PI * 1.5) % (Math.PI * 2);
}
Color3D.prototype.getSat = function() {
	return Math.sqrt(Math.pow(this.hsl.y, 2) + Math.pow(this.hsl.z, 2));
}
Color3D.prototype.getVal = function() {
	return this.hsl.x / 1.72;
}

Color3D.prototype.getBrightness = function() {
	// return this.getVal();
	return (this.rgb.x + this.rgb.y * 2 + this.rgb.z * .5) / 3.5;
}

Color3D.prototype.setHue = function(val) {
{'fraction_non_alphanumeric': 0.16357308584686775, 'fraction_numerical': 0.03799303944315545, 'mean_word_length': 5.316849816849817, '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': '5403916', 'n_tokens_mistral': 1385, 'n_tokens_neox': 1256, 'n_words': 232}