Skip to content

CSS style color raising InvalidParameter when using plain generator #519

@mcfadden

Description

@mcfadden

When reaching out to the plain generator with a color option that uses the css style colors a Dragonfly::ParamValidators::InvalidParameter exception is raised.

Example - from within another generator:

  content.generate!(:plain, 100, 100, "format" => "png", "color" => "rgba(40,200,30,0.5)")

It looks like the color attribute is validated with is_word but that regex does not support css-style colors.

Other values that are failing, but should work:

  • #CCC
  • rgb(255,255,255)
  • #333

I have worked around it with a monkeypatch for now. I'm happy to open a PR if css style colors are still intended to be supported.

dragonfly version: 1.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions