0.0
Low commit activity in last 3 years
No release in over a year
Finds colors on a given webpage
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
>= 0
~> 2.9

Runtime

 Project Readme

ColorParser

The ColorParser gem provides a simple way to parse the colors from an HTML page. It scans both the HTML and CSS to find all colors and sort them by frequency used.

Example

Get colors on a given webpage

page = ColorParser::Page.new("http://google.com/")
colors = page.colors
=> {"ffffff"=>5, "c9d7f1"=>1, "0000cc"=>2, "dd8e27"=>1, "990000"=>1, 
    "3366cc"=>3, "000000"=>2, "1111cc"=>5, "cccccc"=>2, "551a8b"=>1}

colors = page.colors_by_frequency
=> ["ffffff", "1111cc", "3366cc", "000000", "cccccc", 
    "0000cc", "dd8e27", "c9d7f1", "990000", "551a8b"]

Installation

To install ColorParser, add the gem to your Gemfile:

gem "color_parser"

LICENSE

Copyright (c) 2013 Derek DeVries

Released under the MIT License