Popular recipes tagged "color" but not "convert" and "macbook_pro"http://code.activestate.com/recipes/tags/color-convert-macbook_pro/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> 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> DUAL 4 Bit Vertical Coloured Analogue Bar Graph Generator DEMO... (Python) 2011-05-04T17:58:08-07:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/577685-dual-4-bit-vertical-coloured-analogue-bar-graph-ge/ <p style="color: grey"> Python recipe 577685 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/analogue/">analogue</a>, <a href="/recipes/tags/anim/">anim</a>, <a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/bargraph/">bargraph</a>, <a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/colour/">colour</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/display/">display</a>, <a href="/recipes/tags/linux/">linux</a>). </p> <p>This is a two channel version of the "Four Bit Vertical Coloured Analogue Bar Graph Generator DEMO...".</p> <p>These are DUAL LED style "VU" meters in the vertical plane...</p> <p>This is for standard Python 3.x.x.</p> <p>It has different overload beeps for each channel, and has all the unwanted code has been removed.</p> <p>It demonstrates how to obtain multichannel ability, (it is possible to add more channels).</p> <p>Enjoy finding simple solutions to often very difficult problems...</p> <p>Bazza...</p> Seven Bit Colored Analogue Bar Graph Generator DEMO... (Python) 2011-03-17T22:14:52-07:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/577612-seven-bit-colored-analogue-bar-graph-generator-dem/ <p style="color: grey"> Python recipe 577612 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/analogue/">analogue</a>, <a href="/recipes/tags/anim/">anim</a>, <a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/bargraph/">bargraph</a>, <a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/colour/">colour</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/display/">display</a>, <a href="/recipes/tags/linux/">linux</a>). Revision 3. </p> <p>..For STANDARD Python 2.6 and above...</p> <p>This code will display a horizontal full colour analogue "VU" style meter. It displays green for normal, yellow for warning and red for danger with a critical error beep near the end of full scale, at value 120+.</p> <p>This version is for Python 2.6 and above and only for the Linux, (*nix?), platform.</p> <p>It is an "at a glance" display that is in colour rather than having to read say a digitally generated number.</p> <p>A Python 3.x version can be found here:-</p> <p><a href="http://www.linuxformat.com/forums/viewtopic.php?t=13443" rel="nofollow">http://www.linuxformat.com/forums/viewtopic.php?t=13443</a></p> <p>This has uses "for at a glance" voltmeters, ammeters, data-loggers, anemometers etc, etc...</p> <p>Watch for wordwrapping etc...</p> <p>NOTE:- This is Public Domain and you may do with it as you please.</p> <p>73...</p> <p>Bazza, G0LCU...</p> <p>Team AMIGA...</p> Four Bit Vertical Coloured Analogue Bar Graph Generator DEMO... (Python) 2011-04-23T20:50:55-07:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/577675-four-bit-vertical-coloured-analogue-bar-graph-gene/ <p style="color: grey"> Python recipe 577675 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/analogue/">analogue</a>, <a href="/recipes/tags/anim/">anim</a>, <a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/bargraph/">bargraph</a>, <a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/colour/">colour</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/display/">display</a>, <a href="/recipes/tags/linux/">linux</a>). </p> <p>This is a(n) LED style "VU" meter in the vertical plane instead of the horizontal one in the recipe below:-</p> <p><a href="http://code.activestate.com/recipes/577612-seven-bit-colored-analogue-bar-graph-generator-dem/?in=lang-python" rel="nofollow">http://code.activestate.com/recipes/577612-seven-bit-colored-analogue-bar-graph-generator-dem/?in=lang-python</a></p> <p>It is another "AT A GLANCE" display with an overload error beep too.</p> <p>This is for Linux only and tested on Python 2.6.x although it should work on earlier 2.x.x versions.</p> <p>A Python 3.x.x version can be found here:-</p> <p><a href="http://www.linuxformat.com/forums/viewtopic.php?t=13637" rel="nofollow">http://www.linuxformat.com/forums/viewtopic.php?t=13637</a></p> <p>This is issued as Public Domain and you may do with it as you please.</p> <p>Enjoy finding simple solutions to often very difficult problems...</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>