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

Dominant color extraction for Media.imageCssSet #1

Open
roelvangils opened this issue Jun 19, 2018 · 0 comments
Open

Dominant color extraction for Media.imageCssSet #1

roelvangils opened this issue Jun 19, 2018 · 0 comments

Comments

@roelvangils
Copy link
Member

If you use this in your CSS:

<%= Media.imageCssSet('bg.jpg', {width: '100%'}) %>

You get this:

background-image: url(/media/static/bg.jpg?width=100%25)

It would be interesting, if the dominant background color of the image coule be extracted automatically, and added to the background shorthand CSS property.

For example, if the dominant color would be black:

background: #0000 url(/media/static/bg.jpg?width=100%25)

(This should be cached etc.) :)

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

No branches or pull requests

1 participant