Tag: 渐变

Javascript颜色渐变

在有或没有Jquery的情况下使用javascript,我需要根据开始和结束的颜色创build一个渐变颜色。 这是可能的编程方式吗? 最终的颜色只会是开始颜色的深色阴影,并且是无序的列表,我无法控制li项目的数量。 我正在寻找一个解决scheme,允许我select一个开始和结束颜色,将hex值转换为RGB,因此可以在代码中操作。 开始的RGB值通过基于项目数计算的步长值增加。 所以如果列表有8个项目,那么它需要以8个步骤递增分开的红绿蓝值来实现最终的颜色。 有没有更好的方法来做到这一点,如果是的话,我在哪里可以find一些示例代码?

我可以沿着SVGpath应用渐变吗?

我想在我的网站上放置一个由脚本触发的简单加载指示器。 它应该是一个简单的圆弧,它有一个渐变,并在用户等待时旋转。 我还没有尝试animation部分,但现在暂时停留在静态样式上。 这是迄今为止我所得到的: <svg version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg" width="100" height="100"> <defs> <linearGradient id="grad1"> <stop offset="0%" stop-color="red"/> <stop offset="100%" stop-color="transparent"/> </linearGradient> </defs> <path d="M50 10 A40 40 0 1 0 90 50" stroke="url(#grad1)" stroke-width="10" fill="transparent"/> </svg> 它从顶部边缘逆时针旋转到右边缘(270°),但是梯度是错误的。 而不是沿着path开始(顶边0°)不透明,末端(右边270°)是透明的,弧形笔划的结果图像在屏幕空间中从左到右着色。 我怎样才能使渐变沿着我的弧线?

你可以添加噪声CSS3渐变?

有没有可能在CSS中添加一个渐变的噪音? 这是我的径向渐变代码: body { color: #575757; font: 14px/21px Arial, Helvetica, sans-serif; background-color: #2f3b4b; background: -moz-radial-gradient(center 45deg, circle closest-corner, #2f3b4b 0%, #3e4f63 100%); background: -webkit-gradient(radial, center center, 10, center center, 900, from(#2f3b4b), to(#3e4f63)); } 我会添加什么,有噪音的顶部,给它的质感?

如何删除默认的Bootstrap 3传送带控制背景渐变?

我敢肯定,这是我需要修改的代码,但由于某种原因,我不能让梯度消失在IE浏览器。 我希望他们完全消失! .carousel-control { text-shadow: none; opacity: 1; filter: alpha(opacity=100) } .carousel-control.left { background-image: -webkit-gradient(linear, 0 top, 100% top, from(rgba(0,0,0,0.5)), to(rgba(0,0,0,0.0001))); background-image: -webkit-linear-gradient(left, color-stop(rgba(0,0,0,0.5) 0), color-stop(rgba(0,0,0,0.0001) 100%)); background-image: -moz-linear-gradient(left, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%); background-image: linear-gradient(to right, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%); background-repeat: repeat-x; filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1) } .carousel-control.right { background-image: -webkit-gradient(linear, 0 top, 100% top, from(rgba(0,0,0,0.0001)), […]

在背景图片上使用css渐变

我一直试图在我的背景图像上使用线性渐变,以便在背景的底部从黑色变为透明但是看起来无法使其显示。 我已经阅读了其他案例和例子,但没有一个为我工作。 我只能看到渐变或图像,但不能同时看到。 这是链接 只要点击第一个标志,忽略那个效果,我想要的是在整个网站的身体之后。 这是我的CSS代码: body { background: url('http://www.skrenta.comhttp://img.dovov.comstackoverflow.jpg') no-repeat, -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.1)), to(rgba(0, 0, 0, 1))); }

Internet Explorer中的渐变颜色

我知道Internet Explorer有一些专有的扩展,所以你可以做一些事情,比如创build带有渐变背景的div。 我不记得元素名称或它的用法。 有没有人有一些例子或链接?

如何使透明渐变?

我有以下渐变: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:startColor="#ECECEC" android:centerColor="#F6F6F4" android:endColor="#F8F8F6" android:angle="90" android:dither="true" /> </shape> 我想这是透明的,因为在我的ListView中,我将其设置为我的ListSelector: <ListView android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/ARListView" android:background="@drawable/transparent_background" android:cacheColorHint="#00000000" android:drawSelectorOnTop="true" android:listSelector="@drawable/stocks_selected_gradient"> </ListView>

在android中的循环渐变

我试图做一个渐变,从屏幕中间发出的白色,并转向黑色,因为它向屏幕边缘移动。 当我做出这样的“正常”渐变时,我一直在尝试不同的形状: <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:startColor="#E9E9E9" android:endColor="#D4D4D4" android:angle="270"/> </shape> 当使用“椭圆形”形状时,我至less有一个圆形,但没有梯度效果。 我怎么能做到这一点?

从UIColor获得稍微更亮和更深的颜色

我正在寻找能够把任何UIColor变成一个渐变。 我打算这样做的方式是使用Core Graphics绘制渐变。 我想要做的是获得一个颜色,让我们说: [UIColor colorWithRed:0.5 green:0.5 blue:0.5 alpha:1.0]; 并得到一个颜色深一些,色调较浅的UIColor。 有谁知道如何做到这一点? 谢谢。

Android的LinearLayout渐变背景

我无法对LinearLayout应用渐变背景。 这应该是相对简单的,因为我已经阅读,但它似乎并没有工作。 有关参考资料,我正在开发2.1-update1。 header_bg.xml: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:angle="90" android:startColor="#FFFF0000" android:endColor="#FF00FF00" android:type="linear"/> </shape> main_header.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="50dip" android:orientation="horizontal" android:background="@drawable/header_bg"> </LinearLayout> 如果我将@ drawable / header_bg更改为一种颜色 – 例如#FF0000,它可以很好地工作。 我在这里错过了很明显的东西吗