
# see https://mycarta.wordpress.com/2013/02/21/perceptual-rainbow-palette-the-method/
# and https://mycarta.wordpress.com/2013/03/06/perceptual-rainbow-palette-the-goodies/

cubeYFrgb = [
    0.515100000000000 0.048200000000000 0.669700000000000
    0.515898208833707 0.056090405818443 0.678507004736174
    0.516602625686953 0.063937810746495 0.687238897518437
    0.517219112558518 0.071741790110892 0.695894349148579
    0.517753531447181 0.079501919238369 0.704472030428390
    0.518211744351720 0.087217773455659 0.712970612159658
    0.518599613270914 0.094888928089498 0.721388765144175
    0.518923000203542 0.102514958466620 0.729725160183728
    0.519187767148382 0.110095439913759 0.737978468080108
    0.519399776104213 0.117629947757650 0.746147359635104
    0.519564889069815 0.125118057325028 0.754230505650506
    0.519688968043965 0.132559343942626 0.762226576928104
    0.519777875025443 0.139953382937181 0.770134244269685
    0.519837472013027 0.147299749635426 0.777952178477042
    0.519873621005496 0.154598019364096 0.785679050351962
    0.519892184001628 0.161847767449925 0.793313530696235
    0.519899023000204 0.169048569219648 0.800854290311651
    0.519900000000000 0.176200000000000 0.808300000000000
    0.519719353197973 0.183322319854640 0.815720757279215
    0.519195325357450 0.190431820903915 0.823172569049792
    0.518354785326770 0.197522126559592 0.830632970187359
    0.517224601954270 0.204586860233435 0.838079495567547
    0.515831644088289 0.211619645337211 0.845489680065986
    0.514202780577165 0.218614105282685 0.852841058558304
    0.512364880269235 0.225563863481624 0.860111165920133
    0.510344812012837 0.232462543345792 0.867277537027101
    0.508169444656310 0.239303768286956 0.874317706754838
    0.505865647047992 0.246081161716881 0.881209209978974
    0.503460288036220 0.252788347047333 0.887929581575140
    0.500980236469334 0.259418947690079 0.894456356418963
    0.498452361195669 0.265966587056883 0.900767069386075
    0.495903531063566 0.272424888559511 0.906839255352105
    0.493360614921361 0.278787475609729 0.912650449192683
    0.490850481617393 0.285047971619304 0.918178185783438
    0.488400000000000 0.291200000000000 0.923400000000000
    0.485834103257308 0.297234005081926 0.928568605531681
    0.482983048947002 0.303152030445487 0.933909879830708
    0.479881692471761 0.308965098377897 0.939361103417085
    0.476564889234263 0.314684231166368 0.944859556810815
    0.473067494637187 0.320320451098114 0.950342520531901
    0.469424364083211 0.325884780460347 0.955747275100348
    0.465670352975012 0.331388241540280 0.961011101036158
    0.461840316715269 0.336841856625128 0.966071278859334
    0.457969110706660 0.342256648002101 0.970865089089881
    0.454091590351863 0.347643637958414 0.975329812247802
    0.450242611053557 0.353013848781280 0.979402728853099
    0.446457028214420 0.358378302757910 0.983021119425778
    0.442769697237129 0.363748022175520 0.986122264485840
    0.439215473524364 0.369134029321320 0.988643444553290
    0.435829212478802 0.374547346482525 0.990521940148131
    0.432645769503121 0.379998995946347 0.991695031790367
    0.429700000000000 0.385500000000000 0.992100000000000
    0.426955627689028 0.391040776795806 0.992033430311701
    0.424341857441582 0.396601282269409 0.991837733911093
    0.421841766388028 0.402176845383000 0.991518929794611
    0.419438431658726 0.407762795098774 0.991083036958688
    0.417114930384041 0.413354460378921 0.990536074399758
    0.414854339694334 0.418947170185636 0.989884061114255
    0.412639736719970 0.424536253481110 0.989133016098613
    0.410454198591311 0.430117039227536 0.988288958349266
    0.408280802438720 0.435684856387107 0.987357906862647
    0.406102625392560 0.441235033922016 0.986345880635191
    0.403902744583195 0.446762900794454 0.985258898663332
    0.401664237140986 0.452263785966615 0.984102979943502
    0.399370180196297 0.457733018400691 0.982884143472138
    0.397003650879491 0.463165927058875 0.981608408245671
    0.394547726320931 0.468557840903360 0.980281793260537
    0.391985483650979 0.473904088896337 0.978910317513168
    0.389300000000000 0.479200000000000 0.977500000000000
    0.386485815291723 0.484459106596542 0.975760221040460
    0.383556495925275 0.489697308284900 0.973433158841523
    0.380523658744115 0.494913484852387 0.970574029230938
    0.377398920591702 0.500106516086313 0.967238048036456
    0.374193898311494 0.505275281773991 0.963480431085827
    0.370920208746951 0.510418661702730 0.959356394206802
    0.367589468741531 0.515535535659843 0.954921153227132
    0.364213295138692 0.520624783432641 0.950229923974566
    0.360803304781893 0.525685284808435 0.945337922276855
    0.357371114514594 0.530715919574536 0.940300363961749
    0.353928341180252 0.535715567518256 0.935172464857000
    0.350486601622327 0.540683108426906 0.930009440790356
    0.347057512684277 0.545617422087797 0.924866507589570
    0.343652691209560 0.550517388288241 0.919798881082390
    0.340283754041636 0.555381886815548 0.914861777096569
    0.336962318023963 0.560209797457031 0.910110411459855
    0.333700000000000 0.565000000000000 0.905600000000000
    0.330482489796562 0.569753771265260 0.901247329027488
    0.327285486357999 0.574473796931106 0.896925424471454
    0.324105620204068 0.579161070071084 0.892623861587620
    0.320939521854528 0.583816583758738 0.888332215631710
    0.317783821829136 0.588441331067614 0.884040061859447
    0.314635150647651 0.593036305071257 0.879736975526553
    0.311490138829831 0.597602498843214 0.875412531888754
    0.308345416895434 0.602140905457029 0.871056306201771
    0.305197615364218 0.606652517986248 0.866657873721327
    0.302043364755942 0.611138329504417 0.862206809703147
    0.298879295590364 0.615599333085080 0.857692689402953
    0.295702038387241 0.620036521801784 0.853105088076468
    0.292508223666332 0.624450888728074 0.848433580979416
    0.289294481947396 0.628843426937495 0.843667743367520
    0.286057443750189 0.633215129503593 0.838797150496503
    0.282793739594471 0.637566989499912 0.833811377622089
    0.279500000000000 0.641900000000000 0.828700000000000
    0.275984612289327 0.646244368674252 0.823419276244787
    0.272107656090870 0.650621840812154 0.817945310154802
    0.267943300383189 0.655020715915885 0.812297444761467
    0.263565714144843 0.659429293487622 0.806495023096205
    0.259049066354389 0.663835873029545 0.800557388190440
    0.254467525990387 0.668228754043831 0.794503883075594
    0.249895262031396 0.672596236032659 0.788353850783091
    0.245406443455974 0.676926618498208 0.782126634344354
    0.241075239242681 0.681208200942655 0.775841576790806
    0.236975818370074 0.685429282868180 0.769518021153870
    0.233182349816713 0.689578163776960 0.763175310464969
    0.229769002561157 0.693643143171175 0.756832787755527
    0.226809945581964 0.697612520553001 0.750509796056966
    0.224379347857693 0.701474595424619 0.744225678400710
    0.222551378366903 0.705217667288206 0.737999777818181
    0.221400206088152 0.708830035645940 0.731851437340803
    0.221000000000000 0.712300000000000 0.725800000000000
    0.221158864597120 0.715631854287593 0.719835177732689
    0.221618060578300 0.718845821346623 0.713926672306033
    0.222351491228271 0.721954094030321 0.708063811496819
    0.223333059831763 0.724968865191914 0.702235923081833
    0.224536669673507 0.727902327684631 0.696432334837864
    0.225936224038233 0.730766674361700 0.690642374541697
    0.227505626210672 0.733574098076348 0.684855369970121
    0.229218779475555 0.736336791681806 0.679060648899922
    0.231049587117612 0.739066948031301 0.673247539107888
    0.232971952421574 0.741776759978061 0.667405368370806
    0.234959778672170 0.744478420375315 0.661523464465462
    0.236986969154133 0.747184122076292 0.655591155168645
    0.239027427152191 0.749906057934218 0.649597768257141
    0.241055055951077 0.752656420802324 0.643532631507737
    0.243043758835520 0.755447403533838 0.637385072697221
    0.244967439090251 0.758291198981987 0.631144419602380
    0.246800000000000 0.761200000000000 0.624800000000000
    0.248620409474781 0.764181339323832 0.618327943764038
    0.250519929338712 0.767226691237550 0.611721670549682
    0.252490903747682 0.770324160916551 0.604996442805570
    0.254525676857579 0.773461853536234 0.598167522980336
    0.256616592824292 0.776627874271995 0.591250173522619
    0.258755995803710 0.779810328299233 0.584259656881055
    0.260936229951722 0.782997320793345 0.577211235504280
    0.263149639424216 0.786176956929728 0.570120171840931
    0.265388568377081 0.789337341883780 0.563001728339645
    0.267645360966205 0.792466580830900 0.555871167449058
    0.269912361347478 0.795552778946483 0.548743751617806
    0.272181913676788 0.798584041405929 0.541634743294527
    0.274446362110024 0.801548473384634 0.534559404927857
    0.276698050803075 0.804434180057995 0.527532998966433
    0.278929323911828 0.807229266601412 0.520570787858891
    0.281132525592174 0.809921838190281 0.513688034053868
    0.283300000000000 0.812500000000000 0.506900000000000
    0.285441030391755 0.814970358148540 0.500173127924337
    0.287571511027906 0.817353839911381 0.493464278901938
    0.289693702570368 0.819660032200184 0.486774343653453
    0.291809865681056 0.821898521926612 0.480104212899533
    0.293922261021885 0.824078896002326 0.473454777360828
    0.296033149254770 0.826210741338987 0.466826927757990
    0.298144791041628 0.828303644848257 0.460221554811668
    0.300259447044372 0.830367193441798 0.453639549242513
    0.302379377924918 0.832410974031271 0.447081801771176
    0.304506844345182 0.834444573528338 0.440549203118308
    0.306644106967079 0.836477578844660 0.434042644004559
    0.308793426452524 0.838519576891898 0.427563015150580
    0.310957063463431 0.840580154581716 0.421111207277021
    0.313137278661718 0.842668898825773 0.414688111104533
    0.315336332709298 0.844795396535732 0.408294617353766
    0.317556486268087 0.846969234623253 0.401931616745372
    0.319800000000000 0.849200000000000 0.395600000000000
    0.322015737312730 0.851508952431154 0.388971277701778
    0.324162879421189 0.853901005610339 0.381797811217510
    0.326259163698117 0.856361227341876 0.374201767441860
    0.328322327516257 0.858874685430085 0.366305313269494
    0.330370108248352 0.861426447679288 0.358230615595075
    0.332420243267142 0.864001581893804 0.350099841313269
    0.334490469945371 0.866585155877956 0.342035157318741
    0.336598525655780 0.869162237436064 0.334158730506156
    0.338762147771111 0.871717894372449 0.326592727770178
    0.340999073664106 0.874237194491431 0.319459316005472
    0.343327040707508 0.876705205597332 0.312880662106703
    0.345763786274057 0.879106995494473 0.306978932968536
    0.348327047736497 0.881427631987174 0.301876295485636
    0.351034562467569 0.883652182879756 0.297694916552668
    0.353904067840016 0.885765715976541 0.294556963064295
    0.356953301226579 0.887753299081848 0.292584601915185
    0.360200000000000 0.889600000000000 0.291900000000000
    0.363752939278655 0.891356573845279 0.291951234025230
    0.367692949971565 0.893082120648976 0.292100691608455
    0.371995853137442 0.894774225590923 0.292342006010974
    0.376637469834999 0.896430473850951 0.292668810494086
    0.381593621122946 0.898048450608892 0.293074738319093
    0.386840128059997 0.899625741044576 0.293553422747292
    0.392352811704864 0.901159930337836 0.294098497039985
    0.398107493116257 0.902648603668503 0.294703594458471
    0.404079993352890 0.904089346216408 0.295362348264050
    0.410246133473474 0.905479743161382 0.296068391718021
    0.416581734536721 0.906817379683258 0.296815358081685
    0.423062617601343 0.908099840961867 0.297596880616341
    0.429664603726052 0.909324712177039 0.298406592583290
    0.436363513969560 0.910489578508608 0.299238127243830
    0.443135169390580 0.911592025136403 0.300085117859262
    0.449955391047822 0.912629637240256 0.300941197690885
    0.456800000000000 0.913600000000000 0.301800000000000
    0.463933237700690 0.914547747009667 0.302782114404216
    0.471590354506306 0.915512698672784 0.303992700421243
    0.479703684829818 0.916485220383418 0.305402246162532
    0.488205563084191 0.917455677535638 0.306981239739531
    0.497028323682396 0.918414435523513 0.308700169263692
    0.506104301037399 0.919351859741111 0.310529522846465
    0.515365829562169 0.920258315582500 0.312439788599298
    0.524745243669674 0.921124168441750 0.314401454633643
    0.534174877772882 0.921939783712928 0.316385009060949
    0.543587066284760 0.922695526790103 0.318360939992666
    0.552914143618277 0.923381763067344 0.320299735540244
    0.562088444186400 0.923988857938719 0.322171883815134
    0.571042302402099 0.924507176798296 0.323947872928785
    0.579708052678340 0.924927085040144 0.325598190992647
    0.588018029428092 0.925238948058332 0.327093326118170
    0.595904567064322 0.925433131246928 0.328403766416804
    0.603300000000000 0.925500000000000 0.329500000000000
    0.610324263437393 0.925500000000000 0.330448063816230
    0.617152714711127 0.925500000000000 0.331337369435639
    0.623800821432705 0.925500000000000 0.332173466902187
    0.630284051213629 0.925500000000000 0.332961906259830
    0.636617871665404 0.925500000000000 0.333708237552528
    0.642817750399530 0.925500000000000 0.334418010824239
    0.648899155027512 0.925500000000000 0.335096776118921
    0.654877553160852 0.925500000000000 0.335750083480533
    0.660768412411053 0.925500000000000 0.336383482953033
    0.666587200389617 0.925500000000000 0.337002524580379
    0.672349384708049 0.925500000000000 0.337612758406530
    0.678070432977850 0.925500000000000 0.338219734475444
    0.683765812810524 0.925500000000000 0.338829002831079
    0.689450991817573 0.925500000000000 0.339446113517394
    0.695141437610500 0.925500000000000 0.340076616578347
    0.700852617800808 0.925500000000000 0.340726062057896
    0.706600000000000 0.925500000000000 0.341400000000000
    0.712355184459726 0.925500000000000 0.342087365110182
    0.718079256852663 0.925500000000000 0.342773389281185
    0.723771912921851 0.925500000000000 0.343458068337796
    0.729432848410332 0.925500000000000 0.344141398104801
    0.735061759061146 0.925500000000000 0.344823374406989
    0.740658340617336 0.925500000000000 0.345503993069147
    0.746222288821943 0.925500000000000 0.346183249916061
    0.751753299418008 0.925500000000000 0.346861140772519
    0.757251068148571 0.925500000000000 0.347537661463308
    0.762715290756675 0.925500000000000 0.348212807813215
    0.768145662985361 0.925500000000000 0.348886575647028
    0.773541880577669 0.925500000000000 0.349558960789533
    0.778903639276642 0.925500000000000 0.350229959065518
    0.784230634825320 0.925500000000000 0.350899566299770
    0.789522562966745 0.925500000000000 0.351567778317076
    0.794779119443958 0.925500000000000 0.352234590942224
    0.800000000000000 0.925500000000000 0.352900000000000
]

cmap = []
for i = 1:256
    push!(cmap, RGB(cubeYFrgb[i, 1], cubeYFrgb[i, 2], cubeYFrgb[i, 3]))
end

function cubeYF()
    return cmap
end
