我想知道是否有可能生成饱和度+亮度的掩码,例如在颜色选择器中使用(类似于 http://johndyer.name/lab/colorpicker/refresh_web/colorpicker/images/map-hue.png )但在 css3 中仅使用线性渐变? 我尝试了几件事,例如:
background: linear-gradient(to right, hsla(0,100%,0,0) 0%, hsla(0,0%,0%,.5) 100%), /* saturation mask */
linear-gradient(to top, hsla(0,0%,0%,.5) 0%, hsla(0,0%,100%,.5) 100%), /* lightness mask */
但是我做不出像图片这样的东西,找不到合适的组合,而且因为我不是很了解,所以我不知道是否可以。
谢谢
最佳答案
这可能是你写的方式。
100%)
,
/* li
:)ele {
background:
linear-gradient(0deg, hsla(0,0%,0%,.5) 0%, hsla(0,0%,100%,.5) 100%) no-repeat left ,
white linear-gradient(180deg, hsla(0,0%,0%,.5) 0%, hsla(0,0%,100%,.5) 100%) no-repeat right;
background-size:95% 100%, 5% 100%;
}
http://codepen.io/anon/pen/ubDsr (渐变覆盖 body )
https://stackoverflow.com/questions/17224383/
相关文章:
database - 是否有任何工具可以从数据库模式的 json 表示自动生成 ERD 图?
android-layout - 在滑动选项卡中水平滚动 : android
json - 将 JSON 数据加载到大查询中时出错 : flat value specified
ruby-on-rails - rails 和 Heroku : Running a script
linux - 为什么我得到数据大小大于 mss 的数据包?
c++-cli - 导出 C++/CLI native 类 (C4679)
ajax - 我可以添加 Access-Control-Allow-Origin : * to th