[{"data":1,"prerenderedAt":618},["ShallowReactive",2],{"navigation_docs":3,"-guide-finding":65,"-guide-finding-surround":613},[4,31,47],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":30},"Guide","i-lucide-book-open","\u002Fguide","1.guide",[10,15,20,25],{"title":11,"path":12,"stem":13,"icon":14},"Basics","\u002Fguide\u002Fbasics","1.guide\u002F1.basics","i-lucide-package",{"title":16,"path":17,"stem":18,"icon":19},"Catalogue","\u002Fguide\u002Fcatalogue","1.guide\u002F2.catalogue","i-lucide-layout-grid",{"title":21,"path":22,"stem":23,"icon":24},"Finding Schemes","\u002Fguide\u002Ffinding","1.guide\u002F3.finding","i-lucide-search",{"title":26,"path":27,"stem":28,"icon":29},"Good Practice","\u002Fguide\u002Fgoodpractice","1.guide\u002F4.goodpractice","i-lucide-shield-check",false,{"title":32,"icon":33,"path":34,"stem":35,"children":36,"page":30},"Examples","i-lucide-layers","\u002Fexamples","2.examples",[37,42],{"title":38,"path":39,"stem":40,"icon":41},"Plotting & 3D","\u002Fexamples\u002Fplotting","2.examples\u002F1.plotting","i-lucide-box",{"title":43,"path":44,"stem":45,"icon":46},"Image Processing","\u002Fexamples\u002Fimages","2.examples\u002F2.images","i-lucide-image",{"title":48,"icon":49,"path":50,"stem":51,"children":52,"page":30},"Reference","i-lucide-library","\u002Freference","3.reference",[53,58],{"title":54,"path":55,"stem":56,"icon":57},"References","\u002Freference\u002Freferences","3.reference\u002F1.references","i-lucide-graduation-cap",{"title":59,"path":60,"stem":61,"children":62,"icon":64},"Function Index","\u002Freference\u002Ffunctionindex","3.reference\u002F2.functionindex",[63],{"title":59,"path":60,"stem":61,"icon":64},"i-lucide-braces",{"id":66,"title":21,"body":67,"description":606,"extension":607,"links":608,"meta":609,"navigation":610,"path":22,"seo":611,"stem":23,"__hash__":612},"docs\u002F1.guide\u002F3.finding.md",{"type":68,"value":69,"toc":603},"minimark",[70,75,104,246,251,258,596,599],[71,72,74],"h1",{"id":73},"finding-schemes-in-colorschemes","Finding Schemes in ColorSchemes",[76,77,78,82,83,86,87,91,92,95,96,99,100,103],"p",{},[79,80,81],"code",{},"color-schemes-js"," provides the function ",[79,84,85],{},"getInverse(cscheme, color)",", which is the ",[88,89,90],"em",{},"inverse"," of ",[79,93,94],{},"get(cscheme, t)",". Given an RGB color value, this function evaluates the scheme and returns a normalized value between ",[79,97,98],{},"0.0"," and ",[79,101,102],{},"1.0"," corresponding to the closest matching position along the scheme's axis.",[105,106,111],"pre",{"className":107,"code":108,"language":109,"meta":110,"style":110},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { getInverse, colorschemes } from 'color-schemes-js';\n\nconst targetColor = { r: 120, g: 40, b: 180 };\nconst normalizedPosition = getInverse(colorschemes.viridis, targetColor);\n\u002F\u002F => returns position e.g. 0.42\n","typescript","",[79,112,113,154,161,210,239],{"__ignoreMap":110},[114,115,118,122,126,130,133,136,139,142,145,148,151],"span",{"class":116,"line":117},"line",1,[114,119,121],{"class":120},"s7zQu","import",[114,123,125],{"class":124},"sMK4o"," {",[114,127,129],{"class":128},"sTEyZ"," getInverse",[114,131,132],{"class":124},",",[114,134,135],{"class":128}," colorschemes",[114,137,138],{"class":124}," }",[114,140,141],{"class":120}," from",[114,143,144],{"class":124}," '",[114,146,81],{"class":147},"sfazB",[114,149,150],{"class":124},"'",[114,152,153],{"class":124},";\n",[114,155,157],{"class":116,"line":156},2,[114,158,160],{"emptyLinePlaceholder":159},true,"\n",[114,162,164,168,171,174,176,180,183,187,189,192,194,197,199,202,204,207],{"class":116,"line":163},3,[114,165,167],{"class":166},"spNyl","const",[114,169,170],{"class":128}," targetColor ",[114,172,173],{"class":124},"=",[114,175,125],{"class":124},[114,177,179],{"class":178},"swJcz"," r",[114,181,182],{"class":124},":",[114,184,186],{"class":185},"sbssI"," 120",[114,188,132],{"class":124},[114,190,191],{"class":178}," g",[114,193,182],{"class":124},[114,195,196],{"class":185}," 40",[114,198,132],{"class":124},[114,200,201],{"class":178}," b",[114,203,182],{"class":124},[114,205,206],{"class":185}," 180",[114,208,209],{"class":124}," };\n",[114,211,213,215,218,220,223,226,229,232,234,237],{"class":116,"line":212},4,[114,214,167],{"class":166},[114,216,217],{"class":128}," normalizedPosition ",[114,219,173],{"class":124},[114,221,129],{"class":222},"s2Zo4",[114,224,225],{"class":128},"(colorschemes",[114,227,228],{"class":124},".",[114,230,231],{"class":128},"viridis",[114,233,132],{"class":124},[114,235,236],{"class":128}," targetColor)",[114,238,153],{"class":124},[114,240,242],{"class":116,"line":241},5,[114,243,245],{"class":244},"sHwdD","\u002F\u002F => returns position e.g. 0.42\n",[247,248,250],"h2",{"id":249},"practical-example-heatmap-data-extraction","Practical Example: Heatmap Data Extraction",[76,252,253,254,257],{},"One practical application for ",[79,255,256],{},"getInverse()"," is reconstructing continuous scalar data values (such as temperature, elevation, or concentration) from image pixel data when raw numerical values are unavailable.",[105,259,261],{"className":107,"code":260,"language":109,"meta":110,"style":110},"import { getInverse, colorschemes } from 'color-schemes-js';\n\n\u002F\u002F Process array of pixel color data from a canvas or image context\nfunction extractDataFromHeatmap(pixelArray, width, height) {\n  const values = new Float64Array(width * height);\n\n  for (let i = 0; i \u003C pixelArray.length; i += 4) {\n    const pixel = {\n      r: pixelArray[i],\n      g: pixelArray[i + 1],\n      b: pixelArray[i + 2]\n    };\n    \n    \u002F\u002F Map pixel back to continuous value [0.0, 1.0]\n    const pixelIndex = i \u002F 4;\n    values[pixelIndex] = getInverse(colorschemes.temperaturemap, pixel);\n  }\n\n  return values;\n}\n",[79,262,263,287,291,296,327,358,363,415,428,450,474,496,502,508,514,533,569,575,580,590],{"__ignoreMap":110},[114,264,265,267,269,271,273,275,277,279,281,283,285],{"class":116,"line":117},[114,266,121],{"class":120},[114,268,125],{"class":124},[114,270,129],{"class":128},[114,272,132],{"class":124},[114,274,135],{"class":128},[114,276,138],{"class":124},[114,278,141],{"class":120},[114,280,144],{"class":124},[114,282,81],{"class":147},[114,284,150],{"class":124},[114,286,153],{"class":124},[114,288,289],{"class":116,"line":156},[114,290,160],{"emptyLinePlaceholder":159},[114,292,293],{"class":116,"line":163},[114,294,295],{"class":244},"\u002F\u002F Process array of pixel color data from a canvas or image context\n",[114,297,298,301,304,307,311,313,316,318,321,324],{"class":116,"line":212},[114,299,300],{"class":166},"function",[114,302,303],{"class":222}," extractDataFromHeatmap",[114,305,306],{"class":124},"(",[114,308,310],{"class":309},"sHdIc","pixelArray",[114,312,132],{"class":124},[114,314,315],{"class":309}," width",[114,317,132],{"class":124},[114,319,320],{"class":309}," height",[114,322,323],{"class":124},")",[114,325,326],{"class":124}," {\n",[114,328,329,332,335,338,341,344,346,349,352,354,356],{"class":116,"line":241},[114,330,331],{"class":166},"  const",[114,333,334],{"class":128}," values",[114,336,337],{"class":124}," =",[114,339,340],{"class":124}," new",[114,342,343],{"class":222}," Float64Array",[114,345,306],{"class":178},[114,347,348],{"class":128},"width",[114,350,351],{"class":124}," *",[114,353,320],{"class":128},[114,355,323],{"class":178},[114,357,153],{"class":124},[114,359,361],{"class":116,"line":360},6,[114,362,160],{"emptyLinePlaceholder":159},[114,364,366,369,372,375,378,380,383,386,388,391,394,396,399,401,403,406,409,412],{"class":116,"line":365},7,[114,367,368],{"class":120},"  for",[114,370,371],{"class":178}," (",[114,373,374],{"class":166},"let",[114,376,377],{"class":128}," i",[114,379,337],{"class":124},[114,381,382],{"class":185}," 0",[114,384,385],{"class":124},";",[114,387,377],{"class":128},[114,389,390],{"class":124}," \u003C",[114,392,393],{"class":128}," pixelArray",[114,395,228],{"class":124},[114,397,398],{"class":128},"length",[114,400,385],{"class":124},[114,402,377],{"class":128},[114,404,405],{"class":124}," +=",[114,407,408],{"class":185}," 4",[114,410,411],{"class":178},") ",[114,413,414],{"class":124},"{\n",[114,416,418,421,424,426],{"class":116,"line":417},8,[114,419,420],{"class":166},"    const",[114,422,423],{"class":128}," pixel",[114,425,337],{"class":124},[114,427,326],{"class":124},[114,429,431,434,436,438,441,444,447],{"class":116,"line":430},9,[114,432,433],{"class":178},"      r",[114,435,182],{"class":124},[114,437,393],{"class":128},[114,439,440],{"class":178},"[",[114,442,443],{"class":128},"i",[114,445,446],{"class":178},"]",[114,448,449],{"class":124},",\n",[114,451,453,456,458,460,462,464,467,470,472],{"class":116,"line":452},10,[114,454,455],{"class":178},"      g",[114,457,182],{"class":124},[114,459,393],{"class":128},[114,461,440],{"class":178},[114,463,443],{"class":128},[114,465,466],{"class":124}," +",[114,468,469],{"class":185}," 1",[114,471,446],{"class":178},[114,473,449],{"class":124},[114,475,477,480,482,484,486,488,490,493],{"class":116,"line":476},11,[114,478,479],{"class":178},"      b",[114,481,182],{"class":124},[114,483,393],{"class":128},[114,485,440],{"class":178},[114,487,443],{"class":128},[114,489,466],{"class":124},[114,491,492],{"class":185}," 2",[114,494,495],{"class":178},"]\n",[114,497,499],{"class":116,"line":498},12,[114,500,501],{"class":124},"    };\n",[114,503,505],{"class":116,"line":504},13,[114,506,507],{"class":178},"    \n",[114,509,511],{"class":116,"line":510},14,[114,512,513],{"class":244},"    \u002F\u002F Map pixel back to continuous value [0.0, 1.0]\n",[114,515,517,519,522,524,526,529,531],{"class":116,"line":516},15,[114,518,420],{"class":166},[114,520,521],{"class":128}," pixelIndex",[114,523,337],{"class":124},[114,525,377],{"class":128},[114,527,528],{"class":124}," \u002F",[114,530,408],{"class":185},[114,532,153],{"class":124},[114,534,536,539,541,544,547,549,551,553,556,558,561,563,565,567],{"class":116,"line":535},16,[114,537,538],{"class":128},"    values",[114,540,440],{"class":178},[114,542,543],{"class":128},"pixelIndex",[114,545,546],{"class":178},"] ",[114,548,173],{"class":124},[114,550,129],{"class":222},[114,552,306],{"class":178},[114,554,555],{"class":128},"colorschemes",[114,557,228],{"class":124},[114,559,560],{"class":128},"temperaturemap",[114,562,132],{"class":124},[114,564,423],{"class":128},[114,566,323],{"class":178},[114,568,153],{"class":124},[114,570,572],{"class":116,"line":571},17,[114,573,574],{"class":124},"  }\n",[114,576,578],{"class":116,"line":577},18,[114,579,160],{"emptyLinePlaceholder":159},[114,581,583,586,588],{"class":116,"line":582},19,[114,584,585],{"class":120},"  return",[114,587,334],{"class":128},[114,589,153],{"class":124},[114,591,593],{"class":116,"line":592},20,[114,594,595],{"class":124},"}\n",[76,597,598],{},"This maps image pixel colors back to continuous scalar values, allowing analytical operations like finding local minimum\u002Fmaximum anomalies or performing secondary processing.",[600,601,602],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}",{"title":110,"searchDepth":156,"depth":156,"links":604},[605],{"id":249,"depth":156,"text":250},"Learn how to search, filter, and discover color schemes programmatically.","md",null,{},{"icon":24},{"title":21,"description":606},"qZU27HjdTAqc9niunnHvtUFKzqBx2Olw2Kbr-9_9roU",[614,616],{"title":16,"path":17,"stem":18,"description":615,"icon":19,"children":-1},"Explore the complete library of 1,150+ color schemes across all categories.",{"title":26,"path":27,"stem":28,"description":617,"icon":29,"children":-1},"Best practices for choosing perceptually uniform, accessible, and colorblind-safe colormaps.",1784579300793]