0.0
No commit activity in last 3 years
No release in over 3 years
Parse an SVG to discover which colors it contains.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

 Project Readme

SVG Palette

Parse an SVG to discover which colors it contains.

Usage

require "svg_palette"

SVGPalette.parse(File.read("flag_of_togo.svg"))
#=> [RGB [#006a4e], RGB [#ffce00], RGB [#d21034], RGB [#ffffff]]

The array contains instances of Color.

Note: The color black may not be detected unless it is explictly set as a property value.

Properties

The following properties are considered:

fill stroke stop-color flood-color lighting-color style

When checking style rules, only the keys for those properties are considered, e.g:

<foo style="fill:red"></foo>