来自图像的 WebKit 渐变
有谁知道是否有一个工具可以获取图像(.png、.gif 等)并输出图像包含的渐变?
我真的很想在 css 中重新创建此图像 。看起来像是线性和径向渐变的混合,超出了我的 CSS 技能
Does anyone know if there is a tool that will take an image (.png, .gif, etc) and output the gradient that the image contains?
I really want to recreate this image in css. Looks like a mix of linear and radial gradients and is beyond my css skills
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于任何图像处理器来说,从随机图像中获取梯度都是很困难的。通过获取图像的像素数据,找到顶部和底部像素,从中提取颜色数据,然后使用这些值创建渐变,您可能会拥有更好的运气。
Getting the gradient from a random image is going to be tough for any image processor. You would probably have better luck by getting the pixel data for the image, finding the top and bottom pixel, pulling the color data out of them, then using these values to create your gradient.
开始使用这个工具
http://gradients.glrzad.com/ 然后在此处阅读有关径向渐变的信息,使其成为径向http://hacks.mozilla.org/2009/11/css-gradients -firefox-36/
你可以使用该工具达到此目的:
然后将其设为放射状,mozilla 仅在此处
,这是其外观的图像
Get started with this tool
http://gradients.glrzad.com/ and then read about radial gradients here to make it radial http://hacks.mozilla.org/2009/11/css-gradients-firefox-36/
You can get this far with that tool:
Then make it radial, mozilla only here
and here is an image of what it looks like
您的示例是两个径向渐变的重叠。按钮上方中心有一个白色到中蓝色的停止点,到不透明的径向渐变,具有中等不透明度;在简单的蓝色到白色径向渐变的顶部,以右下角为中心。
Your example is an overlap of two radial gradients. There is a white to mid-blue stop to opaque radial gradient centered above the button with a mid-opacity; on top of simple blue to white radial gradient centered to the bottom right.