from matplotlib.colors import LinearSegmentedColormap def main(N: int) -> LinearSegmentedColormap: """ Returns a Parula colormap to be used with matplotlib's `cycler`. `cm_data` has values copied from MATLAB for `parula(64)`. Parameters ---------- N : int Number of RGB quantization levels. Returns ------- LinearSegmentedColormap Parula color map. """ cm_data = [ [0.2422, 0.1504, 0.6603], [0.25039048, 0.16499524, 0.70761429], [0.25777143, 0.18178095, 0.7511381], [0.26472857, 0.19775714, 0.79521429], [0.27064762, 0.21467619, 0.83637143], [0.27511429, 0.2342381, 0.87098571], [0.2783, 0.25587143, 0.89907143], [0.28033333, 0.27823333, 0.9221], [0.2813381, 0.30059524, 0.94137619], [0.28101429, 0.32275714, 0.95788571], [0.27946667, 0.34467143, 0.97167619], [0.27597143, 0.36668095, 0.98290476], [0.26991429, 0.3892, 0.9906], [0.26024286, 0.41232857, 0.99515714], [0.24403333, 0.43583333, 0.99883333], [0.22064286, 0.46025714, 0.99728571], [0.19633333, 0.48471905, 0.98915238], [0.18340476, 0.50737143, 0.97979524], [0.17864286, 0.52885714, 0.96815714], [0.1764381, 0.54990476, 0.95201905], [0.16874286, 0.5702619, 0.93587143], [0.154, 0.5902, 0.9218], [0.14602857, 0.60911905, 0.90785714], [0.13802381, 0.62762857, 0.89729048], [0.12481429, 0.64592857, 0.88834286], [0.11125238, 0.6635, 0.87631429], [0.09520952, 0.67982857, 0.85978095], [0.06887143, 0.69477143, 0.83935714], [0.02966667, 0.70816667, 0.81633333], [0.00357143, 0.72026667, 0.7917], [0.00665714, 0.73121429, 0.76601429], [0.04332857, 0.74109524, 0.73940952], [0.09639524, 0.75, 0.7120381], [0.14077143, 0.7584, 0.68415714], [0.1717, 0.7669619, 0.65544286], [0.19376667, 0.77576667, 0.6251], [0.21608571, 0.7843, 0.5923], [0.24695714, 0.79179524, 0.55674286], [0.29061429, 0.79729048, 0.51882857], [0.34064286, 0.8008, 0.47885714], [0.3909, 0.80287143, 0.43544762], [0.44562857, 0.80241905, 0.39091905], [0.5044, 0.7993, 0.348], [0.5615619, 0.79423333, 0.30448095], [0.61739524, 0.78761905, 0.2612381], [0.67198571, 0.77927143, 0.2227], [0.7242, 0.76984286, 0.19102857], [0.77383333, 0.75980476, 0.16460952], [0.82031429, 0.74981429, 0.15352857], [0.86343333, 0.7406, 0.15963333], [0.90354286, 0.73302857, 0.17741429], [0.93925714, 0.72878571, 0.20995714], [0.97275714, 0.72977143, 0.23944286], [0.99564762, 0.74337143, 0.23714762], [0.99698571, 0.76585714, 0.21994286], [0.99520476, 0.78925238, 0.2027619], [0.9892, 0.81356667, 0.18853333], [0.97862857, 0.83862857, 0.17655714], [0.96764762, 0.8639, 0.16429048], [0.96100952, 0.88901905, 0.15367619], [0.95967143, 0.91345714, 0.14225714], [0.96279524, 0.9373381, 0.12650952], [0.96911429, 0.96062857, 0.1063619], [0.9769, 0.9839, 0.0805], ] return LinearSegmentedColormap.from_list(name="parula", colors=cm_data, N=N)