Project

css-colour

0.0
No commit activity in last 3 years
No release in over 3 years
Ruby CSS Colour validator. It will tell if a colour is either: * inherit, * HEX `#123` or `#123123`, * HSL, * HSLA, * RGB or * RGBA
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.5
>= 0
 Project Readme

CssColour

Build status

Ruby CSS Colour validator.

It will tell if a colour is either:

  • inherit,
  • HEX #123 or #123123,
  • HSL,
  • HSLA,
  • RGB or
  • RGBA

A couple of guidelines were used here:

Installation

Add this line to your application's Gemfile:

gem 'css-colour'

And then execute:

$ bundle

Or install it yourself as:

$ gem install css-colour

Usage

validator = CssColour::Validator.new 'inherit'
validator.valid? # true

You can also test against a specific colour type as follows:

validator = CssColour::Validator.new '#123456'
validator.rgb? # false

TODO

  • Try to fix a colour.

Contributing

  1. Fork it ( http://github.com/dariocravero/css-colour/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request