{"id":10737,"date":"2019-05-17T09:00:07","date_gmt":"2019-05-17T13:00:07","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=10737"},"modified":"2019-05-16T16:18:56","modified_gmt":"2019-05-16T20:18:56","slug":"whats-your-color-scheme","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2019\/05\/17\/whats-your-color-scheme\/","title":{"rendered":"What&#8217;s Your Color Scheme?"},"content":{"rendered":"<div class=\"content\"><!--introduction--><\/p>\n<p><a href=\"http:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/911\">Brett<\/a>&#8216;s Pick this week is <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/53862-matlab-schemer?s_tid=prof_contriblnk\"><tt>MATLAB Schemer<\/tt><\/a>, by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/4273241-scott-lowe\">Scott Lowe<\/a>.<\/p>\n<p><!--\/introduction--><\/p>\n<h3>Contents<\/h3>\n<div>\n<ul>\n<li><a href=\"#5d07344e-83b1-476c-9f9e-8fcdeb9e7e94\">Easy manipulation of your MATLAB color scheme!<\/a><\/li>\n<li><a href=\"#a0b07782-7714-48d8-b198-52e028a21f03\">MATLAB is customizable!<\/a><\/li>\n<\/ul>\n<\/div>\n<h4>Easy manipulation of your MATLAB color scheme!<a name=\"5d07344e-83b1-476c-9f9e-8fcdeb9e7e94\"><\/a><\/h4>\n<p>I&#8217;m curious: what color scheme do you use when you write code in MATLAB? Do you stick with the default, or have you customized the colors in your editor? And are those of you who use Linux more likely to use light text on a dark background than are those of use who work in Windows?<\/p>\n<h4>MATLAB is customizable!<a name=\"a0b07782-7714-48d8-b198-52e028a21f03\"><\/a><\/h4>\n<p>Did you know that you can easily change the colors of your text in MATLAB? In the Preferences dropdown from the Home tab, you can specify the colors of text, background, keywords, strings, comments, errors, hyperlinks, warnings, etc. Check out: Preferences-&gt;Colors to see what I mean:<\/p>\n<p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/pick\/files\/setPrefs.png\" alt=\"\"> <\/p>\n<p>If you want to change the defaults for any reason&#8211;to mitigate eye strain, to help with color-blindness issues, or just to create a more pleasing environment,  you can do that! (And if you like the defaults, you can keep them, too!)<\/p>\n<p>I confess: I have been using MATLAB for so long that the default color scheme seems &#8220;right&#8221; to me, with one exception. Since I often share my screen with others, I find that the default pale yellow for section highlighting doesn&#8217;t work well for me, and I have changed mine in my preferences to be a light cyan; I think it&#8217;s easier to see.<\/p>\n<p>That said, the ease with which I can change my color schemes using Scott&#8217;s &#8220;Schemer&#8221; code has me rethinking my preferences&#8230;. or at least, considering alternatives. To start, I Googled &#8220;preferences for coding color schemes,&#8221; and found lots of discussions about the topic. Many people indicated that they liked the &#8220;monokai&#8221; scheme. So I simply executed the command:<\/p>\n<pre class=\"language-matlab\">schemer_import\r\n<\/pre>\n<p>and launched a file selector. Browsing to Scott&#8217;s directory of pre-saved schemes, I selected &#8220;monokai.prf,&#8221; and <i>voila!<\/i> my text changed to white on a black bacground; strings changed to a pale yellow, highlights changed to blue,&#8230;. you get the point!<\/p>\n<p>Scott provided &#8220;monokai&#8221; and about 10 other color schemes.<\/p>\n<p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/pick\/files\/presets.png\" alt=\"\"> <\/p>\n<p>If you&#8217;ve spent any time customizing your own, please remember to save them:<\/p>\n<pre class=\"language-matlab\">schemer_export\r\n<\/pre>\n<p>before you change things!<\/p>\n<p>This is very useful, though; I get to kick the tires before I buy the car, and I can easily return the car after I&#8217;ve bought it if I decide that I don&#8217;t like it!<\/p>\n<p>Very nice work, Scott! (It&#8217;s evident that many others agree; Schemer has been downloaded 35,000 times [as of this writing]&#8211;including nearly 1400 downloadsthis month&#8211;and has 213 ratings averaging 5 stars [out of 5]!) Outstanding!<\/p>\n<p>As always, I welcome your <a href=\"http:\/\/blogs.mathworks.com\/pick\/?p=10737#respond\">thoughts and comments<\/a>.<\/p>\n<p><script language=\"JavaScript\"> <!-- \n    function grabCode_a87f0ac5e8e54663b8038d580e1f80d0() {\n        \/\/ Remember the title so we can use it in the new page\n        title = document.title;\n\n        \/\/ Break up these strings so that their presence\n        \/\/ in the Javascript doesn't mess up the search for\n        \/\/ the MATLAB code.\n        t1='a87f0ac5e8e54663b8038d580e1f80d0 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\n        t2='##### ' + 'SOURCE END' + ' #####' + ' a87f0ac5e8e54663b8038d580e1f80d0';\n    \n        b=document.getElementsByTagName('body')[0];\n        i1=b.innerHTML.indexOf(t1)+t1.length;\n        i2=b.innerHTML.indexOf(t2);\n \n        code_string = b.innerHTML.substring(i1, i2);\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\n\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \n        \/\/ in the XML parser.\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\n        \/\/ doesn't go ahead and substitute the less-than character. \n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\n\n        copyright = 'Copyright 2019 The MathWorks, Inc.';\n\n        w = window.open();\n        d = w.document;\n        d.write('\n\n<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\n\n\\n');\n\n        d.title = title + ' (MATLAB code)';\n        d.close();\n    }   \n     --> <\/script><\/p>\n<p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><a href=\"javascript:grabCode_a87f0ac5e8e54663b8038d580e1f80d0()\"><span style=\"font-size: x-small;        font-style: italic;\">Get<br \/>\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><\/p>\n<p>      Published with MATLAB&reg; R2019a<\/p>\n<\/div>\n<p><!--\na87f0ac5e8e54663b8038d580e1f80d0 ##### SOURCE BEGIN #####\n%% What's Your Color Scheme?\n%\n% <http:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/911 Brett>'s\n% Pick this week is\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/53862-matlab-schemer?s_tid=prof_contriblnk |MATLAB Schemer|>,\n% by <https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/4273241-scott-lowe Scott Lowe>.\n%\n\n%% Easy manipulation of your MATLAB color scheme!\n% I'm curious: what color scheme do you use when you write code in MATLAB?\n% Do you stick with the default, or have you customized the colors in your\n% editor? And are those of you who use Linux more likely to use light text\n% on a dark background than are those of use who work in Windows?\n\n%% MATLAB is customizable!\n% Did you know that you can easily change the colors of your text in\n% MATLAB? In the Preferences dropdown from the Home tab, you can specify\n% the colors of text, background, keywords, strings, comments, errors,\n% hyperlinks, warnings, etc. Check out: Preferences->Colors to see what I\n% mean:\n\n%%\n% \n% <<https:\/\/blogs.mathworks.com\/pick\/files\/setPrefs.png>>\n% \n%% \n% If you want to change the defaults for any reasonREPLACE_WITH_DASH_DASHto mitigate eye\n% strain, to help with color-blindness issues, or just to create a more\n% pleasing environment,  you can do that! (And if you like the defaults,\n% you can keep them, too!)\n\n%%\n% I confess: I have been using MATLAB for so long that the default color\n% scheme seems \"right\" to me, with one exception. Since I often share my\n% screen with others, I find that the default pale yellow for section\n% highlighting doesn't work well for me, and I have changed mine in my\n% preferences to be a light cyan; I think it's easier to see.\n\n%% \n% That said, the ease with which I can change my color schemes using\n% Scott's \"Schemer\" code has me rethinking my preferences.... or at least,\n% considering alternatives. To start, I Googled \"preferences for coding\n% color schemes,\" and found lots of discussions about the topic. Many\n% people indicated that they liked the \"monokai\" scheme. So I simply\n% executed the command:\n%%\n% \n%   schemer_import\n%\n% and launched a file selector. Browsing to Scott's directory of pre-saved\n% schemes, I selected \"monokai.prf,\" and _voila!_ my text changed to white\n% on a black bacground; strings changed to a pale yellow, highlights\n% changed to blue,.... you get the point!\n\n%%\n% Scott provided \"monokai\" and about 10 other color schemes.\n%%\n% \n% <<https:\/\/blogs.mathworks.com\/pick\/files\/presets.png>>\n% \n\n%%\n% If you've spent any time customizing your own, please remember to save\n% them:\n%%\n% \n%   schemer_export\n% \n% before you change things! \n\n%%\n% \n% This is very useful, though; I get to kick the tires before I buy the\n% car, and I can easily return the car after I've bought it if I decide\n% that I don't like it!\n% \n\n%% \n% Very nice work, Scott! (It's evident that many others agree; Schemer has\n% been downloaded 35,000 times [as of this writing]REPLACE_WITH_DASH_DASHincluding nearly 1400\n% downloadsthis monthREPLACE_WITH_DASH_DASHand has 213 ratings averaging 5 stars [out of 5]!)\n% Outstanding!\n\n%%\n% As always, I welcome your\n% <http:\/\/blogs.mathworks.com\/pick\/?p=10737#respond thoughts and comments>.\n##### SOURCE END ##### a87f0ac5e8e54663b8038d580e1f80d0\n--><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/pick\/files\/setPrefs.png\" onError=\"this.style.display ='none';\" \/><\/div>\n<p>\nBrett&#8216;s Pick this week is MATLAB Schemer, by Scott Lowe.<\/p>\n<p>Contents<\/p>\n<p>Easy manipulation of your MATLAB color scheme!<br \/>\nMATLAB is customizable!<\/p>\n<p>Easy manipulation of your MATLAB color&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2019\/05\/17\/whats-your-color-scheme\/\">read more >><\/a><\/p>\n","protected":false},"author":34,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/10737"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/34"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=10737"}],"version-history":[{"count":6,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/10737\/revisions"}],"predecessor-version":[{"id":10753,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/10737\/revisions\/10753"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=10737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=10737"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=10737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}