0.0
Low commit activity in last 3 years
A long-lived project that still receives updates
Get a language's color on github.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

~> 2.0
 Project Readme

language_colors

This gem was created as a fast way to get the colors that Github uses to describe languages. returns a string in the form of '#00ff00'.

Link to RubyGems

Installation

Add this line to your application's Gemfile:

gem 'language_colors'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install language_colors

Usage

lc = LanguageColors::LanguageColors.new
lc.color('C++')
=> "#f34b7d"

Updating the color list

The colors are generated from GitHub Linguist's languages.yml. To refresh lib/colors.json with the latest data:

$ rake colors

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/SyedAbuTalib/language_colors. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.