RubyGems Navigation menu

colours 0.0.70

This library is called colours. It is a colour-related toolset. It aims to unify colour-related methods and constants into one project, usable for other ruby projects. I needed such a module because I often found myself in need of different, colour-related methods, so I thought that I should bundle them all together into one new project. This gem also supercedes my earlier gems, such as AdvancedColours, AnsiColours, HtmlColours, Konsole and ColourStrings - these projects have all been merged into the Colours project, which also explains a bit why it is fairly large. I really want to bundle colours together and then be done with it. As of version 0.0.3, you can autoinclude this module into your project via: require 'colours/autoinclude' This will make the Colours namespace, the Colours::AnsiColours and the Colours::HtmlColours namespace available. Also, the eparse() method was added as of version 0.0.4, which is a convenience method to use on 'Foo: bar' input. The html component can be used to convert the trivial html colours into corresponding R,G,B values. Convenience methods do exist for this, such as: Colours::HtmlColours.random The methods that are used by the older ColourAid project were sfancy(), swarn(), sdir() and sfile(), among others. There have been fully integrated into the Colours namespace. The Colours gem also has a submodule called konsole, in particular the KDE Konsole. These are colour-related methods that allow us to use R,G,B values for colours too. It thus may be especially useful if you wish to make use of more colours in your ruby scripts when you are also using the KDE Konsole. You will have more than 100 new colours to cherry-pick from! A separate test case exists in the subdirectory test/ to ensure that the basic functionality of the Konsole submodule works in a reliable manner. Some of these tests can output all HTML colours - from the commandline, for instance, this is also possible, by passing in the argument 'html_colours' or simply '1'. Example: konsole_colours html_colours Also have look at the file doc/ and the test/ subdirectory for the tests. Note that bin/konsole_colours is not called bin/konsole because that might conflict with the KDE "konsole" program. If you want to test this module, look at the file in test/ directory, which includes a method that will allow you to test this module like so: Colours.test If you have specific suggestions to make this gem more useful for others, please drop me an email at: Thank you.


  1. 0.0.70 - June 26, 2017 (33.5 KB)
  2. 0.0.69 - June 25, 2017 (33.5 KB)
  3. 0.0.68 - May 14, 2017 (33 KB)
  4. 0.0.67 - March 18, 2017 (33 KB)
  5. 0.0.18 - May 05, 2014 (11.5 KB)
Show all versions (65 total)

Runtime Dependencies (1):


  • Robert A. Heiler



SHA 256 checksum:


Total downloads 49,320

For this version 144

= Copy to clipboard Copied!




Required Ruby Version: >= 2.4.1

Required Rubygems Version: >= 2.6.12