<commit_before>#include "OE/Math/Color.hpp"

namespace OrbitEngine { namespace Math {

	float HueToRGB(float p, float q, float t) {
		if (t < 0.0f) t += 1.0f;
		if (t > 1.0f) t -= 1.0f;
		if (t < 1.0f / 6.0f) return p + (q - p) * 6.0f * t;
		if (t < 1.0f / 2.0f) return q;
		if (t < 2.0f / 3.0f) return p + (q - p) * (2.0f / 3.0f - t) * 6.0f;
		return p;
	}

	Color FromHSL(int h, float s, float l) {
		if (s < 1e-5) { // achromatic
			return Color(l, l, l, 1.0f);
		}

		float q = l < 0.5f ? l * (1.0f + s) : l + s - l * s;
		float p = 2.0f * l - q;

		return Color(
			HueToRGB(p, q, h + 1.0f / 3.0f),
			HueToRGB(p, q, h),
			HueToRGB(p, q, h - 1.0f / 3.0f),
			1.0f<commit_msg>Fixed a bug in FromHSL<commit_after>#include "OE/Math/Color.hpp"

namespace OrbitEngine { namespace Math {

	float HueToRGB(float p, float q, float t) {
		if (t < 0.0f) t += 1.0f;
		if (t > 1.0f) t -= 1.0f;
		if (t < 1.0f / 6.0f) return p + (q - p) * 6.0f * t;
		if (t < 1.0f / 2.0f) return q;
		if (t < 2.0f / 3.0f) return p + (q - p) * (2.0f / 3.0f - t) * 6.0f;
		return p;
	}

	Color FromHSL(int h, float s, float l) {
		if (s < 1e-5) { // achromatic
			return Color(l, l, l, 1.0f);
		}

		float q = l < 0.5f ? l * (1.0f + s) : l + s - l * s;
		float p = 2.0f * l - q;
		float r = (float)h / 360.0f;

		return Color(
			HueToRGB(p, q, r + (1.0f / 3.0f)),
			HueToRGB(p, q, r),
			HueToRGB(p, q, r - (1.0f / 3.0f)),
			1.0f
{'fraction_non_alphanumeric': 0.20483641536273114, 'fraction_numerical': 0.07112375533428165, 'mean_word_length': 1.9373695198329854, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 5, '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': '4707758', 'n_tokens_mistral': 828, 'n_tokens_neox': 729, 'n_words': 209}