<commit_before>class ToolException(Exception):
    pass


__all__ = ['ToolException', 'catscan', 'template_handler', 'abbyy_xml', 'bots', 'date_conversion',
           'make_html_color']


def make_html_color(min_value, max_value, value):
    if max_value > min_value:
        if value > min_value:
            if value < max_value:
                color = (1 - (value - min_value) / (max_value - min_value)) * 255
            else:
                color = 0
        else:
            color = 255
    else:
        if value > max_value:
            if value < min_value:
                color = ((value - max_value) / (min_value - max_value)) * 255
            else:
                color = 255
        else:
            color = 0
    return str(hex(round(color)))[2:].zfill(2).upper()<commit_msg>simplify make html color<commit_after>class ToolException(Exception):
    pass


__all__ = ['ToolException', 'catscan', 'template_handler', 'abbyy_xml', 'bots', 'date_conversion',
           'make_html_color']


def make_html_color(min_value, max_value, value):
    if max_value >= min_value:
        color = (1 - (value - min_value) / (max_value - min_value)) * 255
    else:
        color = ((value - max_value) / (min_value - max_value)) * 255
    color = max(0, min(255, color))
    return str(hex(round(color)))[2:].zfill(2).upper()
{'fraction_non_alphanumeric': 0.13043478260869565, 'fraction_numerical': 0.022488755622188907, 'mean_word_length': 2.3291770573566084, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '2835054', 'n_tokens_mistral': 456, 'n_tokens_neox': 422, 'n_words': 98}