仓库源文站点原文


layout: post title: 科技绘图的调色板 categories:


最近作图的时候, 总觉得默认的线条颜色不是很美观, 就花了点时间, 将常见绘图软件所用的调色板整理总结了一下. 所参考的软件包括:

网上相关的资料也有很多, 就不重复了.

下面给出我整理的所有调色板的示例以及颜色序列, 供参考选择使用.

如果需要在gnuplot中使用这些调色板, 最简单的方法就是将它们定义为相应的变量, 如

basic="#000000 #FF0000 #0000FF #FF00FF #008000 #000080 #8000FF #800080 #800000 #808000 #2B63A2 #1E9696 #9B641A #10C73E #89247A #2DC5CC #3F4198 #93AC2B #808080 #966464 #649664 #2BA3CA #326496"

然后再定义一个宏,

setpal="if(pal eq 'cls'){set colorsequence classic};if(pal ne 'def' && pal ne 'cls'){do for[i=1:words(value(pal))]{set style line i lw 4 lc rgb word(value(pal),i)}}"

这样使用时只要pal='basic'; @setpal即可. 当然也可以将所有的调色板都写入初始化文件, 然后直接调用即可, 避免了每次定义变量的麻烦. 当然, 也可以定义一个函数setpal(pal), 使用eval setpal(pal)进行调用.

<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.min.js"></script><style> table tr:nth-child(2n) { background-color: #FFF; } </style><table style='background-color:#FFF'><tr> <td><canvas id="myChart" width="400" height="600"></canvas></td> <td id='cmq'></td> <td id='cms'></td> </tr></table><table id='tab' style='background-color:#FFF'></table><script> var $=function(id){return document.getElementById(id)} var cm=[] cm['fav' ] ="#1F77B4 #FF7400 #00A13B #D62728 #984EA3 #A65628 #EE0F84 #7F7F7F #BCBD22 #17BECF" cm['basic' ]="#000000 #FF0000 #0000FF #FF00FF #008000 #000080 #8000FF #800080 #800000 #808000 #2B63A2 #1E9696 #9B641A #10C73E #B9247A #2DC5CC #3F4198 #93AC2B #808080 #966464 #649664 #2BA3CA #326496" cm['kelly' ]="#000000 #E6194B #3CB44B #FFE119 #0082C8 #F58231 #911EB4 #46F0F0 #F032E6 #D2F53C #FABEBE #008080 #E6BEFF #AA6E28 #FFFAC8 #800000 #AAFFC3 #808000 #FFD8B1 #000080 #808080" cm['colorblindsafe' ]="#000000 #999999 #E69F00 #56B4E9 #009E73 #F0E442 #0072B2 #D55E00 #CC79A7" cm['color4line' ]="#515151 #F14040 #1A6FDF #37AD6B #B177DE #CC9900 #00CBCC #7D4E4E #8E8E00 #FB6501 #6699CC #6FB802" cm['color4line_dark']="#363636 #C00E0E #114A97 #257448 #7D2DB9 #8A6800 #008A8A #543434 #5E5E00 #A74301 #33679B #4B7C01" cm['iwanthue' ]="#83D4A4 #C059C9 #CF523D #405253 #CDA854 #8FD34E #CC5B88 #A7B5BF #797EC9 #55743A #71412F #5D3761" cm['candy' ]="#EF0000 #336699 #FEC211 #3BC371 #666699 #999999 #FF6666 #6699CC #CC6600 #009999 #6B67BC #99867A #CC3333 #669999 #CC9900" cm['candy_dark' ]="#A20000 #224568 #B68901 #27834B #454567 #676767 #F20000 #33679B #8A4500 #006868 #403C88 #695950 #8A2222 #456767 #8A6800" cm['matlab' ]="#0072BD #D95319 #EDB120 #7E2F8E #77AC30 #4DBEEE #A2142F" cm['seaborn' ]="#4C72B0 #55A868 #C44E52 #8172B2 #CCB974 #64B5CD" cm['d3' ]="#5E9CC6 #FF7D0B #2CA02C #D62728 #9467BD #8C564B" cm["d3_20" ]="#1F77B4 #FF7F0E #2CA02C #D62728 #9467BD #8C564B #E377C2 #7F7F7F #BCBD22 #17BECF #AEC7E8 #FFBB78 #98DF8A #FF9896 #C5B0D5 #C49C94 #F7B6D2 #C7C7C7 #DBDB8D #9EDAE5" cm["d3_20b" ]="#393B79 #637939 #8C6D31 #843C39 #7B4173 #5254A3 #8CA252 #BD9E39 #AD494A #A55194 #6B6ECF #B5CF6B #E7BA52 #D6616B #CE6DBD #9C9EDE #CEDB9C #E7CB94 #E7969C #DE9ED6" cm["d3_20c" ]="#3182BD #E6550D #31A354 #756BB1 #636363 #6BAED6 #FD8D3C #74C476 #9E9AC8 #969696 #9ECAE1 #FDAE6B #A1D99B #BCBDDC #BDBDBD #C6DBEF #FDD0A2 #C7E9C0 #DADAEB #D9D9D9" cm['tableau' ] ="#5E9CC6 #FF7400 #00A13B #EF0028 #9E63B5 #985247 #F66EB8 #7F7C77 #C2BD2C" cm['vega' ] ="#1F77B4 #FF7F0E #2CA02C #D62728 #9467BD #8C564B #E377C2 #7F7F7F #BCBD22 #17BECF" cm['set' ] ="#377EB8 #FF7F00 #4DAF4A #E41A1C #984EA3 #A65628 #F781BF #999999 #FFFF33" cm['altmetric' ] ="#FF0000 #ffd140 #74CFED #2445bd #958899 #E065BB #D5E8F0 #94DB5E #A60000" cm['new' ] ="#000000 #16469D #BD202D #00A14B #4B96D1 #F16521 #9F6EAF" cm['new1' ] ="#DE0000 #43AE3A #1572C7 #FFC000 #A5A5A5 #FF7E25 #1599D6" cm['new2' ] ="#B44500 #005D93 #43AE3A #1572C7 #FFC000 #A4A4A4 #FF7D24 #189AD7" cm['medium' ] ="#729ECE #FF9E4A #67BF5C #ED665D #AD8BC9 #A8786E #ED97CA #A2A2A2 #CDCC5D #6DCCDA" cm['medium_old' ]="#609DCA #FF9641 #38C25D #FF5B4E #B887C3 #B67365 #FE90C2 #A4A59B #D2CC5A" cm['set1' ] ="#E41A1C #377EB8 #4DAF4A #984EA3 #FF7F00 #FFFF33 #A65628 #F781BF #999999" cm['set1_dark' ] ="#991111 #25557C #347632 #67356F #AC5600 #CECE00 #703A1B #EE0F84 #676767" cm['dark2' ]="#1B9E77 #D95F02 #7570B3 #E7298A #66A61E #E6AB02 #A6761D #666666" cm['dark2_dark' ] ="#126B51 #923F01 #484480 #A7125C #447014 #9C7601 #6F4F13 #454545" cm['accent' ]="#7FC97F #BEAED4 #FDC086 #FFFF99 #386CB0 #F0027F #BF5B17 #666666" cm['accent_dark' ]="#429B42 #7D5CA9 #FB7C0B #FFFF15 #264877 #A30156 #813D10 #454545" cm['paired' ]="#A6CEE3 #1F78B4 #B2DF8A #33A02C #FB9A99 #E31A1C #FDBF6F #FF7F00 #CAB2D6 #6A3D9A #FFFF99 #B15928" cm['paired_dark' ]="#4497C4 #155179 #77C034 #226C1E #F71A1A #991111 #F18C03 #AC5600 #915FA9 #482969 #FFFF15 #783C1B" cm['paired1' ]="#97D7F2 #07AEE3 #EAA5C2 #DC4959 #B3D49D #35B257 #EDC194 #F09137 #BDBEDC #626FB3 #F6EDAA #F9E753" cm['paired1_dark' ]="#24AAE3 #047499 #D13A7A #A6202E #73AD4B #23783A #DB832B #B85F0E #6668AE #3D467C #E9D130 #DAC507" cm['vegapaired' ]="#1F77B4 #AEC7E8 #FF7F0E #FFBB78 #2CA02C #98DF8A #D62728 #FF9896 #9467BD #C5B0D5 #8C564B #C49C94 #E377C2 #F7B6D2 #7F7F7F #C7C7C7 #BCBD22 #DBDB8D #17BECF #9EDAE5" cm['trafficlight' ]="#B10318 #DBA13A #309343 #D82526 #FFC156 #69B764 #F26C64 #FFDD71 #9FCD99" cm['pastel1' ]="#FBB4AE #B3CDE3 #CCEBC5 #DECBE4 #FED9A6 #FFFFCC #E5D8BD #FDDAEC #F2F2F2" cm['pastel2' ]="#B3E2CD #FDCDAC #CBD5E8 #F4CAE4 #E6F5C9 #FFF2AE #F1E2CC #CCCCCC" cm['set2' ]="#66C2A5 #FC8D62 #8DA0CB #E78AC3 #A6D854 #FFD92F #E5C494 #B3B3B3" cm['set2_dark' ]="#398E73 #E84304 #48639F #CE2B91 #76A626 #CCA800 #CD8F32 #797979" cm['set3_5' ]="#FF6C91 #BC9D00 #00BB57 #00B8E5 #CD79FF" cm['set3_12' ]="#8DD3C7 #FFFFB3 #BEBADA #FB8072 #80B1D3 #FDB462 #B3DE69 #FCCDE5 #D9D9D9 #BC80BD #CCEBC5 #FFED6F" cm["Office" ]="#44546A #5B9BD5 #ED7D31 #A5A5A5 #FFC000 #4472C4 #70AD47 #0563C1 #954F72" cm["Office 10" ]="#1F497D #4F81BD #C0504D #9BBB59 #8064A2 #4BACC6 #F79646 #0000FF #800080" cm["Office 中性" ]="#775F55 #94B6D2 #DD8047 #A5AB81 #D8B25C #7BA79D #968C8C #F7B615 #704404" cm["Office 纸张" ]="#444D26 #A5B592 #F3A447 #E7BC29 #D092A7 #9C85C0 #809EC2 #8E58B6 #7F6F6F" cm["Office 字幕" ]="#5E5E5E #418AB3 #A6B727 #F69200 #838383 #FEC306 #DF5327 #F59E00 #B2B2B2" cm["Office 气流" ]="#212745 #4E67C8 #5ECCF3 #A7EA52 #5DCEAF #FF8021 #F14124 #56C7AA #59A8D1" cm["Office 视点" ]="#323232 #F07F09 #9F2936 #1B587C #4E8542 #604878 #C19859 #6B9F25 #B26B02" cm["nature" ]="#E64B35 #4DBBD5 #00A087 #3C5488 #F39B7F #8491B4 #91D1C2 #DC0000 #7E6148 #B09C85" cm["science" ]="#3B4992 #EE0000 #008B45 #631879 #008280 #BB0021 #5F559B #A20056 #808180 #1B1919" cm["nejm" ]="#BC3C29 #0072B5 #E18727 #20854E #7876B1 #6F99AD #FFDC91 #EE4C97" cm["lancet" ]="#00468B #ED0000 #42B540 #0099B4 #925E9F #FDAF91 #AD002A #ADB6B6 #1B1919" cm["jama" ]="#374E55 #DF8F44 #00A1D5 #B24745 #79AF97 #6A6599 #80796B" cm["jco" ]="#0073C2 #EFC000 #868686 #CD534C #7AA6DC #003C67 #8F7700 #3B3B3B #A73030 #4A6990" cm["locuszoom" ]="#D43F3A #EEA236 #5CB85C #46B8DA #357EBD #9632B8 #B8B8B8" cm["uchicago" ]="#800000 #767676 #FFA319 #8A9045 #155F83 #C16622 #8F3931 #58593F #350E20" cm["uchicago_light" ]="#800000 #D6D6CE #FFB547 #ADB17D #5B8FA8 #D49464 #B1746F #8A8B79 #725663" cm["uchicago_dark" ]="#800000 #767676 #CC8214 #616530 #0F425C #9A5324 #642822 #3E3E23 #350E20" cm['rainbow' ]="#FF0000 #FF6600 #FFEE00 #00FF00 #007DFF #4400FF #9900FF" cm['rainbow_dark' ]="#AC0000 #AC4500 #AC9F00 #00AC00 #0056AC #3000AC #6700AC" cm['rainbowiso' ]="#D70E0E #A35C05 #868600 #009251 #3F5DE4 #7C2DDE #B700B7" cm['rainbowiso_dark']="#F34B4B #F99924 #FFFF0D #13FF95 #758AEC #A46CE8 #FF28FF" cm['parula' ]="#352A87 #0F5CDD #1481D6 #06A4CA #2EB7A4 #87BF77 #D1BB59 #FEC832 #F9FB0E" cm['viridis' ]="#440154 #472C7A #3B518B #2C718E #21908D #27AD81 #5CC863 #AADC32 #FDE725" cm['moreland' ]="#3B4CC0 #688AEF #99BAFF #C9D8EF #EDD1C2 #F7A789 #E36A53 #B40426" cm['bluered_6' ]="#2C69B0 #F02720 #AC613C #6BA3D6 #EA6B73 #E9C39B" cm['bluered_12' ]="#2C69B0 #B5C8E2 #F02720 #FFB6B0 #AC613C #E9C39B #6BA3D6 #B5DFFD #AC8763 #DDC9B4 #BD0A36 #F4737A" cm['blues_3']="#deebf7 #9ecae1 #3182bd" cm['blues_4']="#eff3ff #bdd7e7 #6baed6 #2171b5" cm['blues_5']="#eff3ff #bdd7e7 #6baed6 #3182bd #08519c" cm['blues_6']="#eff3ff #c6dbef #9ecae1 #6baed6 #3182bd #08519c" cm['blues_7']="#eff3ff #c6dbef #9ecae1 #6baed6 #4292c6 #2171b5 #084594" cm['blues_8']="#f7fbff #deebf7 #c6dbef #9ecae1 #6baed6 #4292c6 #2171b5 #084594" cm['blues_9']="#f7fbff #deebf7 #c6dbef #9ecae1 #6baed6 #4292c6 #2171b5 #08519c #08306b" cm['greens_3']="#e5f5e0 #a1d99b #31a354" cm['greens_4']="#edf8e9 #bae4b3 #74c476 #238b45" cm['greens_5']="#edf8e9 #bae4b3 #74c476 #31a354 #006d2c" cm['greens_6']="#edf8e9 #c7e9c0 #a1d99b #74c476 #31a354 #006d2c" cm['greens_7']="#edf8e9 #c7e9c0 #a1d99b #74c476 #41ab5d #238b45 #005a32" cm['greens_8']="#f7fcf5 #e5f5e0 #c7e9c0 #a1d99b #74c476 #41ab5d #238b45 #005a32" cm['greens_9']="#f7fcf5 #e5f5e0 #c7e9c0 #a1d99b #74c476 #41ab5d #238b45 #006d2c #00441b" cm['greys_3']="#f0f0f0 #bdbdbd #636363" cm['greys_4']="#f7f7f7 #cccccc #969696 #525252" cm['greys_5']="#f7f7f7 #cccccc #969696 #636363 #252525" cm['greys_6']="#f7f7f7 #d9d9d9 #bdbdbd #969696 #636363 #252525" cm['greys_7']="#f7f7f7 #d9d9d9 #bdbdbd #969696 #737373 #525252 #252525" cm['greys_8']="#ffffff #f0f0f0 #d9d9d9 #bdbdbd #969696 #737373 #525252 #252525" cm['greys_9']="#ffffff #f0f0f0 #d9d9d9 #bdbdbd #969696 #737373 #525252 #252525 #000000" cm['oranges_3']="#fee6ce #fdae6b #e6550d" cm['oranges_4']="#feedde #fdbe85 #fd8d3c #d94701" cm['oranges_5']="#feedde #fdbe85 #fd8d3c #e6550d #a63603" cm['oranges_6']="#feedde #fdd0a2 #fdae6b #fd8d3c #e6550d #a63603" cm['oranges_7']="#feedde #fdd0a2 #fdae6b #fd8d3c #f16913 #d94801 #8c2d04" cm['oranges_8']="#fff5eb #fee6ce #fdd0a2 #fdae6b #fd8d3c #f16913 #d94801 #8c2d04" cm['oranges_9']="#fff5eb #fee6ce #fdd0a2 #fdae6b #fd8d3c #f16913 #d94801 #a63603 #7f2704" cm['purples_3']="#efedf5 #bcbddc #756bb1" cm['purples_4']="#f2f0f7 #cbc9e2 #9e9ac8 #6a51a3" cm['purples_5']="#f2f0f7 #cbc9e2 #9e9ac8 #756bb1 #54278f" cm['purples_6']="#f2f0f7 #dadaeb #bcbddc #9e9ac8 #756bb1 #54278f" cm['purples_7']="#f2f0f7 #dadaeb #bcbddc #9e9ac8 #807dba #6a51a3 #4a1486" cm['purples_8']="#fcfbfd #efedf5 #dadaeb #bcbddc #9e9ac8 #807dba #6a51a3 #4a1486" cm['purples_9']="#fcfbfd #efedf5 #dadaeb #bcbddc #9e9ac8 #807dba #6a51a3 #54278f #3f007d" cm['reds_3']="#fee0d2 #fc9272 #de2d26" cm['reds_4']="#fee5d9 #fcae91 #fb6a4a #cb181d" cm['reds_5']="#fee5d9 #fcae91 #fb6a4a #de2d26 #a50f15" cm['reds_6']="#fee5d9 #fcbba1 #fc9272 #fb6a4a #de2d26 #a50f15" cm['reds_7']="#fee5d9 #fcbba1 #fc9272 #fb6a4a #ef3b2c #cb181d #99000d" cm['reds_8']="#fff5f0 #fee0d2 #fcbba1 #fc9272 #fb6a4a #ef3b2c #cb181d #99000d" cm['reds_9']="#fff5f0 #fee0d2 #fcbba1 #fc9272 #fb6a4a #ef3b2c #cb181d #a50f15 #67000d" cm['bugn_3']="#e5f5f9 #99d8c9 #2ca25f" cm['bugn_4']="#edf8fb #b2e2e2 #66c2a4 #238b45" cm['bugn_5']="#edf8fb #b2e2e2 #66c2a4 #2ca25f #006d2c" cm['bugn_6']="#edf8fb #ccece6 #99d8c9 #66c2a4 #2ca25f #006d2c" cm['bugn_7']="#edf8fb #ccece6 #99d8c9 #66c2a4 #41ae76 #238b45 #005824" cm['bugn_8']="#f7fcfd #e5f5f9 #ccece6 #99d8c9 #66c2a4 #41ae76 #238b45 #005824" cm['bugn_9']="#f7fcfd #e5f5f9 #ccece6 #99d8c9 #66c2a4 #41ae76 #238b45 #006d2c #00441b" cm['bupu_3']="#e0ecf4 #9ebcda #8856a7" cm['bupu_4']="#edf8fb #b3cde3 #8c96c6 #88419d" cm['bupu_5']="#edf8fb #b3cde3 #8c96c6 #8856a7 #810f7c" cm['bupu_6']="#edf8fb #bfd3e6 #9ebcda #8c96c6 #8856a7 #810f7c" cm['bupu_7']="#edf8fb #bfd3e6 #9ebcda #8c96c6 #8c6bb1 #88419d #6e016b" cm['bupu_8']="#f7fcfd #e0ecf4 #bfd3e6 #9ebcda #8c96c6 #8c6bb1 #88419d #6e016b" cm['bupu_9']="#f7fcfd #e0ecf4 #bfd3e6 #9ebcda #8c96c6 #8c6bb1 #88419d #810f7c #4d004b" cm['gnbu_3']="#e0f3db #a8ddb5 #43a2ca" cm['gnbu_4']="#f0f9e8 #bae4bc #7bccc4 #2b8cbe" cm['gnbu_5']="#f0f9e8 #bae4bc #7bccc4 #43a2ca #0868ac" cm['gnbu_6']="#f0f9e8 #ccebc5 #a8ddb5 #7bccc4 #43a2ca #0868ac" cm['gnbu_7']="#f0f9e8 #ccebc5 #a8ddb5 #7bccc4 #4eb3d3 #2b8cbe #08589e" cm['gnbu_8']="#f7fcf0 #e0f3db #ccebc5 #a8ddb5 #7bccc4 #4eb3d3 #2b8cbe #08589e" cm['gnbu_9']="#f7fcf0 #e0f3db #ccebc5 #a8ddb5 #7bccc4 #4eb3d3 #2b8cbe #0868ac #084081" cm['orrd_3']="#fee8c8 #fdbb84 #e34a33" cm['orrd_4']="#fef0d9 #fdcc8a #fc8d59 #d7301f" cm['orrd_5']="#fef0d9 #fdcc8a #fc8d59 #e34a33 #b30000" cm['orrd_6']="#fef0d9 #fdd49e #fdbb84 #fc8d59 #e34a33 #b30000" cm['orrd_7']="#fef0d9 #fdd49e #fdbb84 #fc8d59 #ef6548 #d7301f #990000" cm['orrd_8']="#fff7ec #fee8c8 #fdd49e #fdbb84 #fc8d59 #ef6548 #d7301f #990000" cm['orrd_9']="#fff7ec #fee8c8 #fdd49e #fdbb84 #fc8d59 #ef6548 #d7301f #b30000 #7f0000" cm['pubu_3']="#ece7f2 #a6bddb #2b8cbe" cm['pubu_4']="#f1eef6 #bdc9e1 #74a9cf #0570b0" cm['pubu_5']="#f1eef6 #bdc9e1 #74a9cf #2b8cbe #045a8d" cm['pubu_6']="#f1eef6 #d0d1e6 #a6bddb #74a9cf #2b8cbe #045a8d" cm['pubu_7']="#f1eef6 #d0d1e6 #a6bddb #74a9cf #3690c0 #0570b0 #034e7b" cm['pubu_8']="#fff7fb #ece7f2 #d0d1e6 #a6bddb #74a9cf #3690c0 #0570b0 #034e7b" cm['pubu_9']="#fff7fb #ece7f2 #d0d1e6 #a6bddb #74a9cf #3690c0 #0570b0 #045a8d #023858" cm['purd_3']="#e7e1ef #c994c7 #dd1c77" cm['purd_4']="#f1eef6 #d7b5d8 #df65b0 #ce1256" cm['purd_5']="#f1eef6 #d7b5d8 #df65b0 #dd1c77 #980043" cm['purd_6']="#f1eef6 #d4b9da #c994c7 #df65b0 #dd1c77 #980043" cm['purd_7']="#f1eef6 #d4b9da #c994c7 #df65b0 #e7298a #ce1256 #91003f" cm['purd_8']="#f7f4f9 #e7e1ef #d4b9da #c994c7 #df65b0 #e7298a #ce1256 #91003f" cm['purd_9']="#f7f4f9 #e7e1ef #d4b9da #c994c7 #df65b0 #e7298a #ce1256 #980043 #67001f" cm['rdpu_3']="#fde0dd #fa9fb5 #c51b8a" cm['rdpu_4']="#feebe2 #fbb4b9 #f768a1 #ae017e" cm['rdpu_5']="#feebe2 #fbb4b9 #f768a1 #c51b8a #7a0177" cm['rdpu_6']="#feebe2 #fcc5c0 #fa9fb5 #f768a1 #c51b8a #7a0177" cm['rdpu_7']="#feebe2 #fcc5c0 #fa9fb5 #f768a1 #dd3497 #ae017e #7a0177" cm['rdpu_8']="#fff7f3 #fde0dd #fcc5c0 #fa9fb5 #f768a1 #dd3497 #ae017e #7a0177" cm['rdpu_9']="#fff7f3 #fde0dd #fcc5c0 #fa9fb5 #f768a1 #dd3497 #ae017e #7a0177 #49006a" cm['ylgn_3']="#f7fcb9 #addd8e #31a354" cm['ylgn_4']="#ffffcc #c2e699 #78c679 #238443" cm['ylgn_5']="#ffffcc #c2e699 #78c679 #31a354 #006837" cm['ylgn_6']="#ffffcc #d9f0a3 #addd8e #78c679 #31a354 #006837" cm['ylgn_7']="#ffffcc #d9f0a3 #addd8e #78c679 #41ab5d #238443 #005a32" cm['ylgn_8']="#ffffe5 #f7fcb9 #d9f0a3 #addd8e #78c679 #41ab5d #238443 #005a32" cm['ylgn_9']="#ffffe5 #f7fcb9 #d9f0a3 #addd8e #78c679 #41ab5d #238443 #006837 #004529" cm['pubugn_3']="#ece2f0 #a6bddb #1c9099" cm['pubugn_4']="#f6eff7 #bdc9e1 #67a9cf #02818a" cm['pubugn_5']="#f6eff7 #bdc9e1 #67a9cf #1c9099 #016c59" cm['pubugn_6']="#f6eff7 #d0d1e6 #a6bddb #67a9cf #1c9099 #016c59" cm['pubugn_7']="#f6eff7 #d0d1e6 #a6bddb #67a9cf #3690c0 #02818a #016450" cm['pubugn_8']="#fff7fb #ece2f0 #d0d1e6 #a6bddb #67a9cf #3690c0 #02818a #016450" cm['pubugn_9']="#fff7fb #ece2f0 #d0d1e6 #a6bddb #67a9cf #3690c0 #02818a #016c59 #014636" cm['ylgnbu_3']="#edf8b1 #7fcdbb #2c7fb8" cm['ylgnbu_4']="#ffffcc #a1dab4 #41b6c4 #225ea8" cm['ylgnbu_5']="#ffffcc #a1dab4 #41b6c4 #2c7fb8 #253494" cm['ylgnbu_6']="#ffffcc #c7e9b4 #7fcdbb #41b6c4 #2c7fb8 #253494" cm['ylgnbu_7']="#ffffcc #c7e9b4 #7fcdbb #41b6c4 #1d91c0 #225ea8 #0c2c84" cm['ylgnbu_8']="#ffffd9 #edf8b1 #c7e9b4 #7fcdbb #41b6c4 #1d91c0 #225ea8 #0c2c84" cm['ylgnbu_9']="#ffffd9 #edf8b1 #c7e9b4 #7fcdbb #41b6c4 #1d91c0 #225ea8 #253494 #081d58" cm['ylorbr_3']="#fff7bc #fec44f #d95f0e" cm['ylorbr_4']="#ffffd4 #fed98e #fe9929 #cc4c02" cm['ylorbr_5']="#ffffd4 #fed98e #fe9929 #d95f0e #993404" cm['ylorbr_6']="#ffffd4 #fee391 #fec44f #fe9929 #d95f0e #993404" cm['ylorbr_7']="#ffffd4 #fee391 #fec44f #fe9929 #ec7014 #cc4c02 #8c2d04" cm['ylorbr_8']="#ffffe5 #fff7bc #fee391 #fec44f #fe9929 #ec7014 #cc4c02 #8c2d04" cm['ylorbr_9']="#ffffe5 #fff7bc #fee391 #fec44f #fe9929 #ec7014 #cc4c02 #993404 #662506" cm['ylorrd_3']="#ffeda0 #feb24c #f03b20" cm['ylorrd_4']="#ffffb2 #fecc5c #fd8d3c #e31a1c" cm['ylorrd_5']="#ffffb2 #fecc5c #fd8d3c #f03b20 #bd0026" cm['ylorrd_6']="#ffffb2 #fed976 #feb24c #fd8d3c #f03b20 #bd0026" cm['ylorrd_7']="#ffffb2 #fed976 #feb24c #fd8d3c #fc4e2a #e31a1c #b10026" cm['ylorrd_8']="#ffffcc #ffeda0 #fed976 #feb24c #fd8d3c #fc4e2a #e31a1c #b10026" cm['ylorrd_9']="#ffffcc #ffeda0 #fed976 #feb24c #fd8d3c #fc4e2a #e31a1c #bd0026 #800026" cm['brbg_3']="#d8b365 #f5f5f5 #5ab4ac" cm['brbg_4']="#a6611a #dfc27d #80cdc1 #018571" cm['brbg_5']="#a6611a #dfc27d #f5f5f5 #80cdc1 #018571" cm['brbg_6']="#8c510a #d8b365 #f6e8c3 #c7eae5 #5ab4ac #01665e" cm['brbg_7']="#8c510a #d8b365 #f6e8c3 #f5f5f5 #c7eae5 #5ab4ac #01665e" cm['brbg_8']="#8c510a #bf812d #dfc27d #f6e8c3 #c7eae5 #80cdc1 #35978f #01665e" cm['brbg_9']="#8c510a #bf812d #dfc27d #f6e8c3 #f5f5f5 #c7eae5 #80cdc1 #35978f #01665e" cm['brbg_10']="#543005 #8c510a #bf812d #dfc27d #f6e8c3 #c7eae5 #80cdc1 #35978f #01665e #003c30" cm['brbg_11']="#543005 #8c510a #bf812d #dfc27d #f6e8c3 #f5f5f5 #c7eae5 #80cdc1 #35978f #01665e #003c30" cm['piyg_3']="#e9a3c9 #f7f7f7 #a1d76a" cm['piyg_4']="#d01c8b #f1b6da #b8e186 #4dac26" cm['piyg_5']="#d01c8b #f1b6da #f7f7f7 #b8e186 #4dac26" cm['piyg_6']="#c51b7d #e9a3c9 #fde0ef #e6f5d0 #a1d76a #4d9221" cm['piyg_7']="#c51b7d #e9a3c9 #fde0ef #f7f7f7 #e6f5d0 #a1d76a #4d9221" cm['piyg_8']="#c51b7d #de77ae #f1b6da #fde0ef #e6f5d0 #b8e186 #7fbc41 #4d9221" cm['piyg_9']="#c51b7d #de77ae #f1b6da #fde0ef #f7f7f7 #e6f5d0 #b8e186 #7fbc41 #4d9221" cm['piyg_10']="#8e0152 #c51b7d #de77ae #f1b6da #fde0ef #e6f5d0 #b8e186 #7fbc41 #4d9221 #276419" cm['piyg_11']="#8e0152 #c51b7d #de77ae #f1b6da #fde0ef #f7f7f7 #e6f5d0 #b8e186 #7fbc41 #4d9221 #276419" cm['prgn_3']="#af8dc3 #f7f7f7 #7fbf7b" cm['prgn_4']="#7b3294 #c2a5cf #a6dba0 #008837" cm['prgn_5']="#7b3294 #c2a5cf #f7f7f7 #a6dba0 #008837" cm['prgn_6']="#762a83 #af8dc3 #e7d4e8 #d9f0d3 #7fbf7b #1b7837" cm['prgn_7']="#762a83 #af8dc3 #e7d4e8 #f7f7f7 #d9f0d3 #7fbf7b #1b7837" cm['prgn_8']="#762a83 #9970ab #c2a5cf #e7d4e8 #d9f0d3 #a6dba0 #5aae61 #1b7837" cm['prgn_9']="#762a83 #9970ab #c2a5cf #e7d4e8 #f7f7f7 #d9f0d3 #a6dba0 #5aae61 #1b7837" cm['prgn_10']="#40004b #762a83 #9970ab #c2a5cf #e7d4e8 #d9f0d3 #a6dba0 #5aae61 #1b7837 #00441b" cm['prgn_11']="#40004b #762a83 #9970ab #c2a5cf #e7d4e8 #f7f7f7 #d9f0d3 #a6dba0 #5aae61 #1b7837 #00441b" cm['puor_3']="#f1a340 #f7f7f7 #998ec3" cm['puor_4']="#e66101 #fdb863 #b2abd2 #5e3c99" cm['puor_5']="#e66101 #fdb863 #f7f7f7 #b2abd2 #5e3c99" cm['puor_6']="#b35806 #f1a340 #fee0b6 #d8daeb #998ec3 #542788" cm['puor_7']="#b35806 #f1a340 #fee0b6 #f7f7f7 #d8daeb #998ec3 #542788" cm['puor_8']="#b35806 #e08214 #fdb863 #fee0b6 #d8daeb #b2abd2 #8073ac #542788" cm['puor_9']="#b35806 #e08214 #fdb863 #fee0b6 #f7f7f7 #d8daeb #b2abd2 #8073ac #542788" cm['puor_10']="#7f3b08 #b35806 #e08214 #fdb863 #fee0b6 #d8daeb #b2abd2 #8073ac #542788 #2d004b" cm['puor_11']="#7f3b08 #b35806 #e08214 #fdb863 #fee0b6 #f7f7f7 #d8daeb #b2abd2 #8073ac #542788 #2d004b" cm['rdgy_3']="#ef8a62 #ffffff #999999" cm['rdgy_4']="#ca0020 #f4a582 #bababa #404040" cm['rdgy_5']="#ca0020 #f4a582 #ffffff #bababa #404040" cm['rdgy_6']="#b2182b #ef8a62 #fddbc7 #e0e0e0 #999999 #4d4d4d" cm['rdgy_7']="#b2182b #ef8a62 #fddbc7 #ffffff #e0e0e0 #999999 #4d4d4d" cm['rdgy_8']="#b2182b #d6604d #f4a582 #fddbc7 #e0e0e0 #bababa #878787 #4d4d4d" cm['rdgy_9']="#b2182b #d6604d #f4a582 #fddbc7 #ffffff #e0e0e0 #bababa #878787 #4d4d4d" cm['rdgy_10']="#67001f #b2182b #d6604d #f4a582 #fddbc7 #e0e0e0 #bababa #878787 #4d4d4d #1a1a1a" cm['rdgy_11']="#67001f #b2182b #d6604d #f4a582 #fddbc7 #ffffff #e0e0e0 #bababa #878787 #4d4d4d #1a1a1a" cm['rdbu_3']="#ef8a62 #f7f7f7 #67a9cf" cm['rdbu_4']="#ca0020 #f4a582 #92c5de #0571b0" cm['rdbu_5']="#ca0020 #f4a582 #f7f7f7 #92c5de #0571b0" cm['rdbu_6']="#b2182b #ef8a62 #fddbc7 #d1e5f0 #67a9cf #2166ac" cm['rdbu_7']="#b2182b #ef8a62 #fddbc7 #f7f7f7 #d1e5f0 #67a9cf #2166ac" cm['rdbu_8']="#b2182b #d6604d #f4a582 #fddbc7 #d1e5f0 #92c5de #4393c3 #2166ac" cm['rdbu_9']="#b2182b #d6604d #f4a582 #fddbc7 #f7f7f7 #d1e5f0 #92c5de #4393c3 #2166ac" cm['rdbu_10']="#67001f #b2182b #d6604d #f4a582 #fddbc7 #d1e5f0 #92c5de #4393c3 #2166ac #053061" cm['rdbu_11']="#67001f #b2182b #d6604d #f4a582 #fddbc7 #f7f7f7 #d1e5f0 #92c5de #4393c3 #2166ac #053061" cm['rdylgn_3']="#fc8d59 #ffffbf #91cf60" cm['rdylgn_4']="#d7191c #fdae61 #a6d96a #1a9641" cm['rdylgn_5']="#d7191c #fdae61 #ffffbf #a6d96a #1a9641" cm['rdylgn_6']="#d73027 #fc8d59 #fee08b #d9ef8b #91cf60 #1a9850" cm['rdylgn_7']="#d73027 #fc8d59 #fee08b #ffffbf #d9ef8b #91cf60 #1a9850" cm['rdylgn_8']="#d73027 #f46d43 #fdae61 #fee08b #d9ef8b #a6d96a #66bd63 #1a9850" cm['rdylgn_9']="#d73027 #f46d43 #fdae61 #fee08b #ffffbf #d9ef8b #a6d96a #66bd63 #1a9850" cm['rdylgn_10']="#a50026 #d73027 #f46d43 #fdae61 #fee08b #d9ef8b #a6d96a #66bd63 #1a9850 #006837" cm['rdylgn_11']="#a50026 #d73027 #f46d43 #fdae61 #fee08b #ffffbf #d9ef8b #a6d96a #66bd63 #1a9850 #006837" cm['rdylbu_3']="#fc8d59 #ffffbf #91bfdb" cm['rdylbu_4']="#d7191c #fdae61 #abd9e9 #2c7bb6" cm['rdylbu_5']="#d7191c #fdae61 #ffffbf #abd9e9 #2c7bb6" cm['rdylbu_6']="#d73027 #fc8d59 #fee090 #e0f3f8 #91bfdb #4575b4" cm['rdylbu_7']="#d73027 #fc8d59 #fee090 #ffffbf #e0f3f8 #91bfdb #4575b4" cm['rdylbu_8']="#d73027 #f46d43 #fdae61 #fee090 #e0f3f8 #abd9e9 #74add1 #4575b4" cm['rdylbu_9']="#d73027 #f46d43 #fdae61 #fee090 #ffffbf #e0f3f8 #abd9e9 #74add1 #4575b4" cm['rdylbu_10']="#a50026 #d73027 #f46d43 #fdae61 #fee090 #e0f3f8 #abd9e9 #74add1 #4575b4 #313695" cm['rdylbu_11']="#a50026 #d73027 #f46d43 #fdae61 #fee090 #ffffbf #e0f3f8 #abd9e9 #74add1 #4575b4 #313695" cm['spectral_3']="#fc8d59 #ffffbf #99d594" cm['spectral_4']="#d7191c #fdae61 #abdda4 #2b83ba" cm['spectral_5']="#d7191c #fdae61 #ffffbf #abdda4 #2b83ba" cm['spectral_6']="#d53e4f #fc8d59 #fee08b #e6f598 #99d594 #3288bd" cm['spectral_7']="#d53e4f #fc8d59 #fee08b #ffffbf #e6f598 #99d594 #3288bd" cm['spectral_8']="#d53e4f #f46d43 #fdae61 #fee08b #e6f598 #abdda4 #66c2a5 #3288bd" cm['spectral_9']="#d53e4f #f46d43 #fdae61 #fee08b #ffffbf #e6f598 #abdda4 #66c2a5 #3288bd" cm['spectral_10']="#9e0142 #d53e4f #f46d43 #fdae61 #fee08b #e6f598 #abdda4 #66c2a5 #3288bd #5e4fa2" cm['spectral_11']="#9e0142 #d53e4f #f46d43 #fdae61 #fee08b #ffffbf #e6f598 #abdda4 #66c2a5 #3288bd #5e4fa2" txt=''; rgb=''; hsv=''; hsl=''; tot=0; ncmq=69 for(map in cm) { txt += '<tr><td>'+map+'</td>' color=cm[map].split(/\s+/) for(i=0, n=color.length; i<n; i++) { rgb=color[i] hsv=rgb2hsv(rgb) hsl=rgb2hsl(rgb) txt +='<td title="HEX: '+rgb+'\nRGB: '+rgb2num(rgb)+'\nHSL: '+hsl+'\nHSV/HSB: '+hsv+'" style="width:1em;background-color:'+rgb+'"></td>' } txt+= '<td style="width:1em;" onClick="cpCM(\''+cm[map]+'\')">复制</td></tr>' /* btn = $('btn'); btn.addEventListener('click',() => { input = document.createElement('input'); input.setAttribute('value', 'hello world'); document.body.appendChild(input); input.select(); if(document.execCommand('copy')) alert('复制成功'); document.body.removeChild(input); }) */ tot++ id = (tot<ncmq) ? 'cmq' : 'cms' name=map; idx=name.replace(/.+_/,"") if(tot<ncmq && idx=='dark') name='dark' if(tot>ncmq && idx>3) name=idx input='<input type="radio" name="cm" id="'+map+'" onClick="setcm(this.id)">'+name if(tot<ncmq && idx=='dark' || tot>=ncmq && idx>3) $(id).innerHTML += ' '+input if(tot<ncmq && idx!='dark' || tot>=ncmq && idx==3) $(id).innerHTML += '<br>'+input } $('tab').innerHTML=txt //$("myChart").style.backgroundColor = '#EBEBEB'; var myChart = new Chart($("myChart").getContext('2d'), { type: 'line', options: { responsive: false, scales: { xAxes: [{ type: 'linear', position: 'bottom' }], yAxes: [{ display: true, ticks: { beginAtZero: true, steps: 10, stepValue: .1, max: 1 } }] }, } }) setcm('fav') function addData(chart, data, label, color) { chart.data.datasets.push({ data: data, label: label, fill: false, // fillColor : "#888", borderColor: color,//曲线边框色, backgroundColor: color,//填充色 //pointBackgroundColor: 'purple',//数据点的填充色 //pointBorderColor: 'blue',//数据点边框颜色 borderWidth: 4,//曲线的宽度 //borderDash: [2, 3], pointBorderWidth: 4,//数据点边框的宽度 pointRadius: 0, //数据点的大小 pointStyle:'circle',//'cross''crossRot''dash''line''rect''rectRounded''rectRot''star''triangle' showLine: true, //如果为false,两数据点之间的线不会渲染 spanGaps: true, //如果为false,NaN data会在折线上有断点 steppedLine: false,//可选值[false, true, 'before', 'after'],为true,折线图的曲线会成直角, }); chart.update(); } function cpCM(cm) { var input = document.createElement('input'); input.setAttribute('value', cm); document.body.appendChild(input); input.select(); if(document.execCommand('copy')) alert('复制成功'); document.body.removeChild(input); } function setcm(map) { myChart.data.datasets=[] var color=cm[map].split(/\s+/), m=color.length var i, data=[], pi2=Math.PI/2 for(i=0; i<m; i++) data[i]=[] var x=0; n=0 while(x<1) { for(i=0; i<m; i++) // data[i][n]={x:x, y:Math.cos(x*pi2)*Math.exp(-x*pi2*i/m)} // data[i][n]={x:x, y:x*Math.tan((i+1)/(m+1)*Math.PI/2)} data[i][n]={x:x, y:(i+1)/m*Math.atan(m/(i+1)*Math.tan((i+1)/(m+.5)*pi2)*x)/pi2} n++ x += 0.01 } for(i=0; i<m; i++) addData(myChart, data[i], i+1, color[i]); } function rgb2num(rgb) { rgb=rgb.substring(1,7) r = parseInt(rgb.substring(0,2), 16); g = parseInt(rgb.substring(2,4), 16); b = parseInt(rgb.substring(4,6), 16); return r+', '+g+', '+b } function rgb2hsl(rgb){ rgb=rgb.substring(1,7) r = parseInt(rgb.substring(0,2), 16)/255; g = parseInt(rgb.substring(2,4), 16)/255; b = parseInt(rgb.substring(4,6), 16)/255; var max = Math.max(r, g, b), min = Math.min(r, g, b), d = max - min; var h, s, l = (max + min)/2; if(l==0 || max==min) s=0 else s = l>0.5 ? 0.5*d/(1-l) : 0.5*d/l; if(max==min) { h = 0; } // achromatic else { switch(max){ case r: h = (g - b)/d + (g < b ? 6 : 0); break; case g: h = (b - r)/d + 2; break; case b: h = (r - g)/d + 4; break; } h /= 6; } h = Math.round(360 * h) + "° "; s = Math.round(s*100)+ "% "; l = Math.round(l*100)+ "% "; return h+s+l; } function rgb2hsv(rgb) { rgb=rgb.substring(1,7) r = parseInt(rgb.substring(0,2), 16)/255; g = parseInt(rgb.substring(2,4), 16)/255; b = parseInt(rgb.substring(4,6), 16)/255; var max = Math.max(r, g, b), min = Math.min(r, g, b), d = max - min; var h, s, v = max; if(max==0) s=0 else s = d/max; if(max==min) { h = 0; } // achromatic else { switch(max){ case r: h = (g - b)/d + (g < b ? 6 : 0); break; case g: h = (b - r)/d + 2; break; case b: h = (r - g)/d + 4; break; } h /= 6; } h = Math.round(360 * h) + "° "; s = Math.round(s*100)+ "% "; v = Math.round(v*100)+ "% "; return h+s+v; } </script>