This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fs from "node:fs"; | |
import { fileURLToPath } from 'url' | |
const __filename = fileURLToPath(import.meta.url) | |
import { Worker, isMainThread, parentPort } from 'node:worker_threads'; | |
import { performance } from "node:perf_hooks"; | |
/** Output filename */ | |
const output_fname = "./results.csv"; | |
/** Use a wrapper around Set, to make the comparison more even for inlined array operations */ | |
const COMPARE_INLINED = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" This searches for an accurate linear approximation of a ".rgb" file gradient. | |
Run it like so: ``python3 cmap_parser.py path/to/color_map.rgb`` | |
See this site for a list of colormaps | |
https://www.ncl.ucar.edu/Document/Graphics/color_table_gallery.shtml | |
""" | |
import random, sys, re, math | |
class RGBApproximation: |