Questions tagged [gradient]

Specifies a range of position-dependent colors, usually used to fill a region.

Specifies a range of position-dependent colors, usually used to fill a region.

enter image description here

3824 questions
111
votes
4 answers

Gradient of n colors ranging from color 1 and color 2

I often work with ggplot2 that makes gradients nice (click here for an example). I have a need to work in base and I think scales can be used there to create color gradients as well but I'm severely off the mark on how. The basic goal is generate…
Tyler Rinker
  • 99,090
  • 56
  • 292
  • 477
86
votes
7 answers

Android: Using linear gradient as background looks banded

I'm trying to apply a linear gradient to my ListView. This is the content of my drawable xml:
Francesco Laurita
  • 22,784
  • 7
  • 52
  • 63
83
votes
2 answers

How do I programmatically set the background color gradient on a Custom Title Bar?

There are many tutorials out there and questions on SO that implement custom title bars. However, in my custom title bar I have a custom gradient for the background and I would like to know how to set it dynamically in my code. Here is where my…
AngeloS
  • 5,248
  • 5
  • 38
  • 58
76
votes
3 answers

How to make transparent gradient?

I have the following gradient:
Sheehan Alam
  • 57,155
  • 123
  • 348
  • 546
76
votes
4 answers

angle attribute in android gradient

I am going through test example. Where for some Image background they are using gradient, the code goes like this
Sharanabasu Angadi
  • 3,934
  • 6
  • 38
  • 63
71
votes
4 answers

Use css gradient over background image

I've been trying to use a linear gradient on top of my background image in order to get a fading effect on the bottom of my background from black to transparent but can't seem to be able to make it show. I've read other cases here and examples but…
Pam
  • 3,760
  • 3
  • 17
  • 17
70
votes
5 answers

Can I apply a gradient along an SVG path?

I'd like to put a simple loading indicator on my website that's triggered by a script. It should be a simple circle arc that's got a gradient and is spinning while the user is waiting. I haven't tried the animation part, but got stuck on the static…
ygoe
  • 14,805
  • 19
  • 92
  • 173
57
votes
4 answers

Using CSS, can you apply a gradient mask to fade to the background over text?

I have a full screen fixed background image. I would like the text in my scrolling div to fade out at the top, presumably by applying a gradient mask to the background at only the top part of the div. I'm interested in having the text look like it…
aviemet
  • 1,061
  • 1
  • 10
  • 18
57
votes
5 answers

CSS gradient checkerboard pattern

I want to create a checkerboard pattern using gradients. I've found an example and modified it to my needs, however it only works with -moz prefix. When I remove the -moz prefix, the pattern is completely different. How can I make this -moz…
Maciej Krawczyk
  • 10,012
  • 5
  • 30
  • 38
57
votes
12 answers

Javascript color gradient

Using javascript with or without Jquery, I need to a create a gradient of colours based on a start and finish color. Is this possible to do programmatically? The end colour is only ever going to be darker shade of the start colour and it's for an…
Dave
  • 571
  • 1
  • 4
  • 3
53
votes
8 answers

Can you add noise to a CSS3 gradient?

Is it possible to add noise to a gradient in CSS? Here is my code for a radial gradient: body { color: #575757; font: 14px/21px Arial, Helvetica, sans-serif; background-color: #2f3b4b; background: -moz-radial-gradient(center 45deg,…
austin
  • 635
  • 2
  • 6
  • 7
52
votes
3 answers

Colour points in a plot differently depending on a vector of values

I'm plotting the plot below using R's plot function. It is a plot of a vector 'shiftTime' of shift in time. I have another vector 'intensity' of the intensity values ranging from ~3 to ~9. I want to color my points in the plot based on those values…
Niek de Klein
  • 7,839
  • 18
  • 67
  • 129
52
votes
2 answers

How to set gradient style to paint object?

The code for drawing an arrow with Style: Fill is given below: paint.setColor(Color.parseColor("#bdc0dc")); paint.setStyle(Style.FILL); canvas.drawPath(arrowPath,…
Rohan K
  • 1,500
  • 4
  • 20
  • 32
51
votes
7 answers

Gradient text color

Is there a generator , or an easy way to generate text like this but without having to define every letter So something like this: .rainbow { background-image: -webkit-gradient( linear, left top, right top, color-stop(0, #f22), color-stop(0.15,…
StabDev
  • 651
  • 3
  • 7
  • 13
51
votes
7 answers

How to create colour gradient in Python?

I want to create a new colormap which interpolates between green and blue (or any other two colours for that matter). My goal is to get something like: First of all I am really not sure if this can be done using linear interpolation of blue and…
Dipole
  • 1,528
  • 2
  • 19
  • 31