<commit_before>#include "color.h"
#include "utilities.h"

#include <math.h>

/*
 * Algorithm adapted from https://gist.github.com/hdznrrd/656996. Uses a little libmath.
 * */
void color_HSV2RGB(struct color_ColorHSV const *hsv, struct color_ColorRGB *rgb) {
   int i;
   float f,p,q,t;
   float h, s, v;

   //expand the u8 hue in range 0->255 to 0->360
   h = 360.0 * ((float)hsv->h / 255.0);

   h = MAX(0.0, MIN(360.0, hsv->h));<commit_msg>Fix problems with HSV->RGB conversion<commit_after>#include "color.h"
#include "utilities.h"

#include <math.h>

/*
 * Algorithm adapted from https://gist.github.com/hdznrrd/656996. Uses a little libmath.
 * */
void color_HSV2RGB(struct color_ColorHSV const *hsv, struct color_ColorRGB *rgb) {
   int i;
   float f,p,q,t;
   float h, s, v;

   //expand the u8 hue in range 0->255 to 0->359* (there are problems at exactly 360)
   h = 359.0 * ((float)hsv->h / 255.0);

   h = MAX(0.0, MIN(360.0, h));
{'fraction_non_alphanumeric': 0.1602972399150743, 'fraction_numerical': 0.06687898089171974, 'mean_word_length': 3.345622119815668, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 2, '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': '7179266', 'n_tokens_mistral': 423, 'n_tokens_neox': 372, 'n_words': 103}