<commit_before>package org.helioviewer.jhv.base.lut;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.TreeMap;

import org.helioviewer.jhv.JHVDirectory;
import org.helioviewer.jhv.JHVGlobals;
import org.helioviewer.jhv.base.FileUtils;
import org.helioviewer.jhv.base.logging.Log;
import org.helioviewer.jhv.viewmodel.metadata.HelioviewerMetaData;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;

public class LUT {

    private static final char angstrom = '\u212B';

    private final String lutName;
    private final int[] lut8;

    public LUT(String name, int[] lookup8) {
        lutName = name;
        lut8 = lookup8;
    }

    public String getName() {
        return lutName;
    }

    public int[] getLut8() {
        return lut8;
    }

    public int[] getLut8Inv() {
        int[] inv = new int[lut8.length];
        int off = lut8.length - 1;

        for (int i = 0; i < lut8.length / 2; i++) {
            inv[i] = lut8[off - i];
            inv[off - i] = lut8[i];
        }
        return inv;
    }

    private static final TreeMap<String, LUT> standardList = new TreeMap<>(JHVGlobals.alphanumComparator);
    // List of rules to apply
    private static JSONArray colorRules;
<commit_msg>Properly invert colormap<commit_after>package org.helioviewer.jhv.base.lut;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.TreeMap;

import org.helioviewer.jhv.JHVDirectory;
import org.helioviewer.jhv.JHVGlobals;
import org.helioviewer.jhv.base.FileUtils;
import org.helioviewer.jhv.base.logging.Log;
import org.helioviewer.jhv.viewmodel.metadata.HelioviewerMetaData;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;

public class LUT {

    private static final char angstrom = '\u212B';

    private final String lutName;
    private final int[] lut8;

    public LUT(String name, int[] lookup8) {
        lutName = name;
        lut8 = lookup8;
    }

    public String getName() {
        return lutName;
    }

    public int[] getLut8() {
        return lut8;
    }

    public int[] getLut8Inv() {
        int len = lut8.length;
        int[] inv = new int[len];

        for (int i = 0; i < len; i++) {
            inv[i] = lut8[len - 1 - i];
        }
        return inv;
    }

    private static final TreeMap<String, LUT> standardList = new TreeMap<>(JHVGlobals.alphanumComparator);
    // List of rules to apply
    private static JSONArray colorRules;

{'fraction_non_alphanumeric': 0.10796036897847626, 'fraction_numerical': 0.01093269559275709, 'mean_word_length': 3.0779944289693595, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '3742742', 'n_tokens_mistral': 1028, 'n_tokens_neox': 1000, 'n_words': 234}