prawnpdf/prawn — pull request #796 by slabounty (2014-10-26 17:51:59+00:00)
Title: Add Ability to Use Color Class

Add the ability to set fill_color, stroke_color, etc. with something
other than a string. This class should have a method color_str that
returns a hex string representing the color.

Accept classes that are "closely related" to String and Array (via the checks for respond_to?(:to_str) and respond_to?(:to_ary).

Add tests for the above. I only saw integration type tests, so that is what I added. If I missed some tests that should be there, please let me know.

I should note that it seems like there should be a Color class in here somewhere and that the fill_color and stroke_color should create these rather than keeping the String/Array directly. However, given how little I know about the code base and design, it's entirely possible, that I'm completely mistaken.