Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS style color raising InvalidParameter when using plain generator #519

Open
mcfadden opened this issue Jun 23, 2022 · 1 comment · May be fixed by #521
Open

CSS style color raising InvalidParameter when using plain generator #519

mcfadden opened this issue Jun 23, 2022 · 1 comment · May be fixed by #521

Comments

@mcfadden
Copy link

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

@markevans
Copy link
Owner

Hi
Thanks for this - this is indeed a bug - a PR would be great thanks - it should just be a case of colour and color being validated by a custom regex rather than is_word. Yes CSS colours should be supported (as far as imagemagick supports them anyway)

@mcfadden mcfadden linked a pull request Jul 7, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants