Popular recipes tagged "color" but not "display"http://code.activestate.com/recipes/tags/color-display/popular/2017-04-17T11:25:02-07:00ActiveState Code RecipesFrame with border color for Tkinter (Python) 2017-04-17T11:25:02-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580735-frame-with-border-color-for-tkinter/ <p style="color: grey"> Python recipe 580735 by <a href="/recipes/users/4189907/">Miguel Martínez López</a> (<a href="/recipes/tags/border/">border</a>, <a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/frame/">frame</a>, <a href="/recipes/tags/tkinter/">tkinter</a>). </p> <p>This trick show how to add a border color to frame. These are the important configurations:</p> <pre class="prettyprint"><code> highlightbackground="your border color here" highlightcolor="your border color here" highlightthickness="the border width" bd= 0 </code></pre> Python AsciiColor and video attributes (Python) 2014-07-24T04:25:53-07:00Mike 'Fuzzy' Partinhttp://code.activestate.com/recipes/users/4179778/http://code.activestate.com/recipes/578908-python-asciicolor-and-video-attributes/ <p style="color: grey"> Python recipe 578908 by <a href="/recipes/users/4179778/">Mike 'Fuzzy' Partin</a> (<a href="/recipes/tags/ascii/">ascii</a>, <a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/dynamic_method/">dynamic_method</a>, <a href="/recipes/tags/metaprogramming/">metaprogramming</a>, <a href="/recipes/tags/python/">python</a>). Revision 5. </p> <p>This is a subclass of a standard str object that adds methods for applying color, and video attributes to text.</p> Log watcher (tail -F *.log) (Python) 2014-04-04T15:54:03-07:00Giampaolo Rodolàhttp://code.activestate.com/recipes/users/4178764/http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/ <p style="color: grey"> Python recipe 577968 by <a href="/recipes/users/4178764/">Giampaolo Rodolà</a> (<a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/log/">log</a>, <a href="/recipes/tags/logging/">logging</a>, <a href="/recipes/tags/monitor/">monitor</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/rotate/">rotate</a>, <a href="/recipes/tags/rotations/">rotations</a>, <a href="/recipes/tags/tail/">tail</a>). Revision 10. </p> <p>A python class which "watches" a directory and calls a callback(filename, lines) function every time one of the files being watched gets written, in real time.</p> <p>Practically speaking, this can be compared to <em>"tail -F *.log"</em> UNIX command, but instead of having lines printed to stdout a python function gets called.</p> <p>Similarly to tail, it takes care of "watching" new files which are created after initialization and "unwatching" those ones which are removed in the meantime. This means you'll be able to "follow" and support also rotating log files.</p> <p><strong>History</strong></p> <ul> <li>rev5 (2013-04-05): <ul> <li>sizehint parameter</li> </ul></li> <li>rev4 (2013-03-16): <ul> <li>python 3 support (also dropped support for python &lt;= 2.5)</li> <li>windows support</li> <li>unit tests</li> <li>main class can also be used as a context manager</li> </ul></li> <li>rev3 (2012-01-13): initial release</li> </ul> Colour Bar And Greyscale Generator For Standard Text Mode Python. (Python) 2013-01-18T21:08:21-08:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578425-colour-bar-and-greyscale-generator-for-standard-te/ <p style="color: grey"> Python recipe 578425 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/bar/">bar</a>, <a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/colour/">colour</a>, <a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/gray/">gray</a>, <a href="/recipes/tags/grey/">grey</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/macbook_pro/">macbook_pro</a>, <a href="/recipes/tags/scale/">scale</a>). </p> <p>This is just a simple colour bar and combined greyscale generator for standard text mode Python...</p> <p>It relies on the _magic_ of the ANSI Escape sequences to work and does mess with the terminal colours but restores the colours back to the defaults...</p> <p>See the code for the machines tested on. It might need the colours adjusting for some terminals but I am sure that is not beyond the average coder...</p> <p>Written so that anyone can see how it works.</p> <p>To hide the cursor the command "tput" is assumed to be available, if not, try "setterm -cursor off" and "setterm -cursor on" instead...</p> <p>Enjoy...</p> <p>Bazza, G0LCU...</p> DistCC 'top' (Python) 2013-12-01T11:19:56-08:00Mike 'Fuzzy' Partinhttp://code.activestate.com/recipes/users/4179778/http://code.activestate.com/recipes/577933-distcc-top/ <p style="color: grey"> Python recipe 577933 by <a href="/recipes/users/4179778/">Mike 'Fuzzy' Partin</a> (<a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/curses/">curses</a>, <a href="/recipes/tags/distcc/">distcc</a>, <a href="/recipes/tags/distributed/">distributed</a>, <a href="/recipes/tags/monitor/">monitor</a>, <a href="/recipes/tags/pack/">pack</a>, <a href="/recipes/tags/struct/">struct</a>, <a href="/recipes/tags/top/">top</a>, <a href="/recipes/tags/unpack/">unpack</a>). Revision 3. </p> <p>A small recipe for a curses based, 'top'-like monitor for DistCC. I know there is already distccmon-text, but I don't like it, and much prefer this sytle of monitoring. Note that I don't keep hosts around in the list like distccmon-gui/gnome. The screen is drawn for exactly what is currently in state. The terminal size is respected at initialization time, however resize events aren't handled. There is color designation of job types.</p> Bash Prompt Rainbow Color Chart (Bash) 2011-10-02T21:39:21-07:00userendhttp://code.activestate.com/recipes/users/4179007/http://code.activestate.com/recipes/577889-bash-prompt-rainbow-color-chart/ <p style="color: grey"> Bash recipe 577889 by <a href="/recipes/users/4179007/">userend</a> (<a href="/recipes/tags/bash/">bash</a>, <a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/prompt/">prompt</a>, <a href="/recipes/tags/ps1/">ps1</a>, <a href="/recipes/tags/rainbow/">rainbow</a>, <a href="/recipes/tags/shell/">shell</a>, <a href="/recipes/tags/terminal/">terminal</a>). </p> <p>This is a simple loop that displays a rainbow of different colors.</p> Coloured / highlighted version of string (Python) 2014-06-03T17:54:33-07:00Giampaolo Rodolàhttp://code.activestate.com/recipes/users/4178764/http://code.activestate.com/recipes/577818-coloured-highlighted-version-of-string/ <p style="color: grey"> Python recipe 577818 by <a href="/recipes/users/4178764/">Giampaolo Rodolà</a> (<a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/debugging/">debugging</a>, <a href="/recipes/tags/highlighting/">highlighting</a>, <a href="/recipes/tags/shell/">shell</a>). Revision 3. </p> <p>Ok, this is really simple but I think it worths a recipe as it's one of those things I always use in shell scripts and for debugging in general.</p> Komodo JS Macro: colorize the output console with a different color scheme (JavaScript) 2011-06-24T17:52:48-07:00Todd Whitemanhttp://code.activestate.com/recipes/users/2666241/http://code.activestate.com/recipes/577770-komodo-js-macro-colorize-the-output-console-with-a/ <p style="color: grey"> JavaScript recipe 577770 by <a href="/recipes/users/2666241/">Todd Whiteman</a> (<a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>, <a href="/recipes/tags/scintilla/">scintilla</a>, <a href="/recipes/tags/toddw/">toddw</a>). </p> <p>It's possible to colorize any Scintilla based widget (the editor part) in Komodo using a color scheme. In Komodo there is the "Fonts and Color" preferences that get applied to all scintilla widgets, but you can manually change individual scintilla widgets as you wish.</p> <p>This macro changes the color scheme of the Command Output tab to use the "Dark" scheme.</p> Color Study 1 (Python) 2011-04-05T23:35:32-07:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577636-color-study-1/ <p style="color: grey"> Python recipe 577636 by <a href="/recipes/users/2608421/">Stephen Chappell</a> (<a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/example/">example</a>, <a href="/recipes/tags/experiment/">experiment</a>, <a href="/recipes/tags/gui/">gui</a>, <a href="/recipes/tags/sandbox/">sandbox</a>). </p> <p>The following program was written to understand how two different color systems related to each other, RGB and HSV. The recipe could be better written and extended further to support other color systems in addition to the two it already uses, but it is a simple example of how one might go about to understand what others speak of when talking about color. The GUI is simple to use and responsive, and the code is a good demonstration of what may need to be written to produce a demonstration such as this one.</p> <p>If you have suggestions or would like to vote this recipe down, please provide an explanation of the problem along with a solution that you would propose and implement to improve upon what is presented.</p> hexadecimal CSS colors, convert the six-digit to the three-digit notation (Bash) 2010-10-02T14:07:23-07:00Romain Dartigueshttp://code.activestate.com/recipes/users/4167472/http://code.activestate.com/recipes/577416-hexadecimal-css-colors-convert-the-six-digit-to-th/ <p style="color: grey"> Bash recipe 577416 by <a href="/recipes/users/4167472/">Romain Dartigues</a> (<a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/css/">css</a>, <a href="/recipes/tags/regex/">regex</a>, <a href="/recipes/tags/rgb/">rgb</a>, <a href="/recipes/tags/sed/">sed</a>, <a href="/recipes/tags/shortening/">shortening</a>). </p> <p>Want to replace all six-digit RGB notation (#rrggbb) to the short (three-digit #rgb) form? Or the opposite?</p> Python RGB and HSV Conversion (Python) 2009-10-01T06:33:56-07:00Michael Foglemanhttp://code.activestate.com/recipes/users/4171845/http://code.activestate.com/recipes/576919-python-rgb-and-hsv-conversion/ <p style="color: grey"> Python recipe 576919 by <a href="/recipes/users/4171845/">Michael Fogleman</a> (<a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/conversion/">conversion</a>, <a href="/recipes/tags/convert/">convert</a>, <a href="/recipes/tags/hsv/">hsv</a>, <a href="/recipes/tags/rgb/">rgb</a>). </p> <p>Python code to convert RGB to HSV and vice-versa.</p> Covert color space from HSV to RGB and RGB to HSV (Python) 2008-11-04T02:13:01-08:00Victor Linhttp://code.activestate.com/recipes/users/4167779/http://code.activestate.com/recipes/576554-covert-color-space-from-hsv-to-rgb-and-rgb-to-hsv/ <p style="color: grey"> Python recipe 576554 by <a href="/recipes/users/4167779/">Victor Lin</a> (<a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/color_space/">color_space</a>, <a href="/recipes/tags/convert/">convert</a>, <a href="/recipes/tags/graph/">graph</a>). </p> <p>Functions for converting bwtween RGB and HSV color space.</p>