linear-gradients

Multi-color linear gradient in WinForms

不打扰是莪最后的温柔 提交于 2019-11-27 19:48:09
How to create multi-color linear gradient in WinForms? System.Drawing.Drawing2D.LinearGradientBrush allows only two colors. punker76 same answer as here: Multi-color diagonal gradient in winforms Multi-color diagonal gradient in winforms Here is a little example void MainFormPaint(object sender, PaintEventArgs e) { LinearGradientBrush br = new LinearGradientBrush(this.ClientRectangle, Color.Black, Color.Black, 0 , false); ColorBlend cb = new ColorBlend(); cb.Positions = new[] {0, 1/6f, 2/6f, 3/6f, 4/6f, 5/6f, 1}; cb.Colors = new[] {Color.Red, Color.Orange, Color.Yellow, Color.Green, Color.Blue

Is it possible based on CSS to create a circle with gradient border and transparent inner?

五迷三道 提交于 2019-11-27 16:24:53
I'm trying to create a circle with CSS that has a gradient border but also a transparent inner so that it looks like this: There are solutions to create a gradient border if the inner is not transparent, which my below snippet is based on, but they work in principle by overlaying a one-coloured div over the gradient. >>JSFIDDLE<< >>SNIPPET<< #cont{ background: -webkit-linear-gradient(left top, crimson 0%, #f90 100%); width: 150px; height: 150px; border-radius: 1000px; padding: 5px; } #box{ background: #fff; width: 150px; height: 150px; border-radius: 1000px; } #example { background: url(http:/

Are “top” and “to top” the same direction for linear gradients?

非 Y 不嫁゛ 提交于 2019-11-27 16:23:28
Browser implementations of linear-gradient() have evolved to support both top and to top as anchor values. Are they the same direction or opposites? They are opposites . to top uses the first color argument at the bottom of the element, while top uses the first color argument at the top. Here's a fiddle . MDN has the full details and history . They are not the same direction; they are opposites. to top is an abbreviation for "bottom to top", whereas top means "start from the top". 1 This is true not only for the other sides, but also for corners such as top right and bottom left . Both

Why can't I reference an SVG linear gradient defined in an external file (paint server)?

∥☆過路亽.° 提交于 2019-11-27 14:48:55
Please have a look at this Pen: http://codepen.io/troywarr/pen/VYmbaa What I'm doing here is: defining an SVG symbol ( <symbol> ) defining an SVG linear gradient ( <linearGradient> ) using the <use> element to reference the SVG symbol I've created in the CSS, defining two classes: external , which references the linear gradient defined in this external .svg file (right click and view source) internal , which references the linear gradient defined in the local HTML (which is, I believe, effectively identical to the one in the external file) Because I've applied the internal class to the <svg>

In-cell data bars in jqGrid - possible or not?

最后都变了- 提交于 2019-11-27 13:22:38
I generally don't like using Excel and Microsoft products in general, but Excel 2007/2010 has some very nice conditional formatting features which, sadly, I haven't seen in many other places so far. One of these which I use extensively in business reports is data bars. http://blogs.msdn.com/b/excel/archive/2009/08/07/data-bar-improvements-in-excel-2010.aspx In my opinion, these data bars are extremely helpful in understanding the meaning of data beyond the numbers. While the difference between 200 and 2000 users is just a hard-to-grasp digit to the human eye, a bar which is 10 times longer is

How to get color value from gradient by percentage with javascript?

前提是你 提交于 2019-11-27 13:04:29
问题 I have a fixed width div with gradient applied using css. I want to build slider based color picker based on this gradient. When i drag the slider i calculate the percentage position, and i want to get the hex or rgb color code based on this value. My idea was to create an array with the start/stop positions and colors defined, then find two values from this array based on the slider position, then somehow find the color between: this is where i can't move forward. Demo: http://jsfiddle.net

Weird gradient border effect

谁都会走 提交于 2019-11-27 12:32:21
When applying a transparent border over an element with a linear-gradient as the background, I get a weird effect. Notice the left and right sides of the element don't have the proper colours (they're some way switched) and are weirdly flat . HTML <div class="colors"> </div> CSS .colors { width: 100px; border: 10px solid rgba(0,0,0,0.2); height: 50px; background: linear-gradient(to right, #78C5D6, #459BA8, #79C267, #C5D647, #F5D63D, #F08B33, #E868A2, #BE61A5); } Why is this showing a weird effect on the left and right side of the element, and What can I do about it? Here is the fiddle: http:/

background image, linear gradient jagged edged result needs to be smooth edged

爷,独闯天下 提交于 2019-11-27 09:16:38
I'm trying to make the bottom of an image pointed. I've tried to get this effect by producing two triangles at the bottom. They must be responsive. and after searching all over the internet with a lot of examples that don't work for my requirement this is the best so far I've managed to produce. body, html { height: 100% } .image { width: 1410px; margin-right: auto; margin-left: auto; height: 500px; overflow: hidden; position: relative; } .pointer { height: 50px; position: absolute; bottom: 0; left: 0; width: 100%; } .triangleWrapper { width: 50%; height: 50px; float: left; } .lefttriangle {

Background with gradient responsive

三世轮回 提交于 2019-11-27 08:29:00
问题 I have the following code: (Fiddle) body { background-color: red; } #grad1 { height: 100px; width: 100%; background: linear-gradient(521deg, rgba(138, 138, 138, 0) 50%, rgba(138, 138, 138, 0) 31.9%, #fff 0.1%, #fff 0%); } <div id="grad1"></div> I basically want the width to be responsive and the gradient's shape to be maintained even though the width changes. What I've tried: Set the width to 100% this doesn't work because its an empty div That's about it, I have no other ideas to be honest.

How to make background-image with linear-gradient work on IE 11?

可紊 提交于 2019-11-27 06:36:56
问题 Any idea how I can make background-image with linear-gradient to work on IE 11? The following code works fine on IE 10 but doesn't work on IE 11. background-image: url(IMAGE), -ms-linear-gradient(top, #ffffff, #BEE38F); I can make linear-gradient to work on IE 6-9, 11 using the following filter but background image is not displayed in this case. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#BEE38F',GradientType=0 ) I'm open to an ideas. Update: