linear-gradients

SVG gradient as polylines stroke background with absolute position

大兔子大兔子 提交于 2020-01-02 21:00:34
问题 Is there the ability to set absolute position of the gradient background applied to polyline? For example when I set gradient: <filter id="black-glow"> <feColorMatrix type="matrix" values= "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0" /> <feGaussianBlur stdDeviation="3" result="coloredBlur" /> <feMerge> <feMergeNode in="coloredBlur" /> <feMergeNode in="SourceGraphic" /> </feMerge> </filter> to polyline's stroke: <polyline points="50,350 ... 350,239" style="fill:none;" stroke="url(#grad1)" stroke

CSS button transition linear-gradient background into transparent background

你。 提交于 2020-01-02 02:57:15
问题 I have a button with a linear-gradient background, orange border, and some text. When I hover over the button, I want the background to become transparent without changing the other properties of the button. I've tried to transition the opacity to 0, but obviously, this will hide the border and text. I've also tried transitioning the background, but it does not work because I don't have an endpoint to transition to since it needs to be transparent. body { background-color: darkblue; } .button

Get color value of specific position in colorbar with gradient

喜夏-厌秋 提交于 2020-01-01 03:11:47
问题 I generated a gradient colobar with CSS3 styles (fiddle) and now want the color value of a specific location (by x and y coords) in that colorbar. As far as I know there is no direct way to do that. I see two options: Implement the gradient algorithm in JavaScript and calculate the value from scratch. Is there an exact definition how that algorithm works for multiple colors? Does the gradient look the same in every browser? Use a canvas and createLinearGradient method to draw the gradient and

How to give “locations” to CAGradientLayer

允我心安 提交于 2019-12-31 12:53:33
问题 I have created CAGradientLayer having three colors, i need to give each color different locations. Example: Red = 0 to 50 % Yellow = 51 to 80 % Green = 81 to 100 % I have tried with giving startPoint and endPoint but it did not work. 回答1: If you put the following code into a Playground you will get the exact desired output: let view = UIView(frame: CGRectMake(0,0,200,100)) let layer = CAGradientLayer() layer.frame = view.frame layer.colors = [UIColor.greenColor().CGColor, UIColor.yellowColor(

How to give “locations” to CAGradientLayer

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-31 12:52:15
问题 I have created CAGradientLayer having three colors, i need to give each color different locations. Example: Red = 0 to 50 % Yellow = 51 to 80 % Green = 81 to 100 % I have tried with giving startPoint and endPoint but it did not work. 回答1: If you put the following code into a Playground you will get the exact desired output: let view = UIView(frame: CGRectMake(0,0,200,100)) let layer = CAGradientLayer() layer.frame = view.frame layer.colors = [UIColor.greenColor().CGColor, UIColor.yellowColor(

How to animate gradient background smoothly

泪湿孤枕 提交于 2019-12-31 07:43:12
问题 I want to achieve an effect than when the user hovers over a div, it's background color turns into a gradient that smoothly switches from one corner to the other, repeatedly, using purely CSS. The effect I want to achieve, trying to put it more into words, is that the darker part of the background (the one with 0.9 opacity) slides from one corner to the other repeatedly as long as the cursor remains above the element. What is actually happening is that the background jumps from one state to

Gradient with Shape

≯℡__Kan透↙ 提交于 2019-12-31 07:12:34
问题 I'm trying to do a gradient on a button but I can't make it have the same gradient as the other part of the button. I tried adding a gradient inside a gradient but it doesn't seems to work and can't find a solution for it. This the code I'm using: button{ color: white; padding: 3px 3px 3px 0px; border: 0px; font-size: 20px; width: 200px; text-align: right; background: linear-gradient(50deg , transparent 50%, rgb(149, 151, 155) 0%) left no-repeat, linear-gradient(rgb(200, 205, 212), rgb(149,

Linear gradient's bounds computation takes parent's bounds in account, not the node on which it is applied on

。_饼干妹妹 提交于 2019-12-31 04:23:05
问题 I want to put a linear gradient on a line(width wise ie across it's stroke width). This line is a child of a Group node. When I apply linear gradient on line, the color stops are calculated using Group's bounds not the lines bounds. In my code below, linear gradient will show up properly when added length-wise ie "to bottom", but not when added width wise, ie "to right". Can anyone tell me what can be work around for this? Here is the SSCCE import javafx.application.Application; import javafx

How to triangle top and bottom border?

时间秒杀一切 提交于 2019-12-31 01:49:08
问题 As you can see in the image below, I am trying to warp or triangle my div from bottom and top, but I have no idea how to do it. I just tried a couple of times to do it, but I couldn't achieve the result. So how can I make it using after,before psuedo? It doesn't matter make with psuedo, but I wonder that how to do it? Here is my code: body{ background:lightblue;; } .block{ background-image: linear-gradient(to right, #314b56, #283b44, #1f2c32, #161e21, #0a0f11); border: 1px solid #fff; width:

BorderColor not picking the linearGradient color on android

一世执手 提交于 2019-12-30 11:55:51
问题 Im trying to create a circle with an image inside it that its border is colourful that's why I used LinearGradient. I was using this guide: https://codeburst.io/linear-gradient-for-border-color-in-react-native-5bcab3eea1c9 the problem that in iOS its working fine as you can see in this image: https://imgur.com/a/Tz0uEcC but on android the when I use borderWidth and choosing borderColor of transparent the borderColor looks like shadow and not picking the LinearGradient color from some reason..