8 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for BustACode

I needed a random color selector. I found one [here](http://peepspower.com/python-script-to-generate-random-css-colors). I rewrote it to make it more general purpose. "f_GenRandomColor" is the picker. The output is in list form, which should make it suitable for most general applications. "f_HTMLRandomColorChart" is just a way to create an HTML table to test …

Member Avatar for snippsat
2
511
Member Avatar for vegaseat

This simple code shows how to write text with a given font, font size and color using the module pygame ...

Member Avatar for lsallen
4
7K
Member Avatar for Adak

Demonstrates the Right Hand Rule maze solving algorithm, with some sweet console colors and text display and erasing, in Windows. Note that if the Start is moved away from all the walls in the maze, the right hand rule fails, circling endlessly. Also, a similar failure happens if the Start …

0
3K
Member Avatar for chriswelborn

This is another useful script I came across. It prints a color-code chart in your terminal. It can help you find the color-code you are looking for, or view the current color-scheme you are using (people use it on reddit/r/unixporn to show off their system's theme, I use it to …

0
371
Member Avatar for vegaseat

A colorful look at the PySide GUI toolkit and its QPainter class and methods. Well commented and demonstrated with the drawing of a number of rectangles and the different ways to apply colors.

1
1K
Member Avatar for EAnder
Member Avatar for Dingbats

Hello Everyone, my first post - so please don't shoot me if it goes wrong! I'd been looking for this for some time now and have seen a number of related queries but no solutions. I cannot take credit for the whole code here, but I did adapt it to …

0
500
Member Avatar for ddanbe

You can make any color you like by setting the r, g and b values of a Color structure. But .NET has a set of predefined colors that you can use by name, so that you can simply set the backgroundcolor of a form with Color.LawnGreen for instance. Ever wondered …

0
770

The End.