Simulating Color Stops in Gradients for Ie

Simulating color stops in gradients for IE

Multiple divs with coordinated gradient colors is the best way (short of using images) to create 3+ color gradients. See fiddle below for a working test:

http://jsfiddle.net/Hauhx/

IE8 gradient filter not working if a background color exists

After glancing over at CSS3please I realized I was doing overkill with my IE7/IE8 gradient styles. Simply using the following style does the job:

filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#444444', EndColorStr='#999999');

Apparently, there is no need for the -ms-filter and zoom rules.

How do I modify IE Gradient CSS to use height and a third color?

The best way to do gradients on IE8/9 is to use CSS3Pie.

This is a Javascript polyfill library that implements the standard CSS gradient syntax into old versions of IE. (it also does a few other features like border-radius).

Simply download the Pie.htc file and add it to your site as per the instructions, and you can start using standard CSS gradients in IE 6-9.

To directly answer your question: CSS3Pie's gradients do support gradient colour stops. (But even without that, the improved syntax over -ms-filter is enough motivation for me to want to use it)

Hope that helps.

CSS Gradients & Shadows on IE

I have been pulling my hair out trying to get the shadows to work on IE... They are working fine in chrome, safari, and firefox! Does someone have experience with this subject?"

Yeah, that's normal. Most people don't bother. Remember to ask yourself, Do Websites Need To Look Exactly The Same In Every Browser?

If you really want this, you'll have to use the gradient filter for IE. Add the following style to your RUNgradient class:

filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorStr="@CLRL~", EndColorStr="@CLRD~")";

Setting linear gradient's starting and ending position in MSIE 9 and older

Unfortunately, it's completely impossible to do it with filter.

However, you can do it using CSS3 PIE, which uses JavaScript.

It's relatively painless:

div {
background-image: -moz-linear-gradient(360deg,rgb(255,255,255) 25% ,rgb(241,123,25) 75%);

-pie-background: linear-gradient(360deg,rgb(255,255,255) 25% ,rgb(241,123,25) 75%);
behavior: url(/PIE.htc);
}

SVG linear gradient dont work in ie11

The gradient has no vector (x1=x2 and y1=y2). According to the SVG specification this degenerate case should result in a single colour which is the last stop colour.

If that's what IE is displaying then it's entirely correct to do so. It's certainly what Firefox will display given such a gradient.

CSS tricks: underline with alpha-gradient on both ends

Use the border-image gradient CSS3.

div {
width:200px;
border-style:solid;
border-width:15px;
text-align: center;
-webkit-border-image:
-webkit-linear-gradient(left, rgba(255,255,255,1) 1%,rgba(0,0,0,1) 50%,rgba(255,255,255,1) 100%) 0 0 100% 0/0 0 15px 0 stretch;
}

Demo here.

This will only work with Webkit browsers (Chrome, Safari etc). There should be some vendor specific equivalents.

How I get color stops on a gradient Shape? VBA

I found the solution:

        With QNode.Shapes(1).Fill
.ForeColor.RGB = RGB(255, 255, 255)
.TwoColorGradient msoGradientVertical, 1
.GradientStops(2).Color = RGB(0, 0, 0)
.GradientStops(2).Position = 0.66
End With

I just have to use GradietStops =D with the position that I want, in that case, I just want two positions, so gradientStops(1) and gradientStops(2), but you also can add more positions.

      .GradientStops.Insert RGB(0, 0, 0), 0.66

SGV Gradients Darker at Stops

There is nothing wrong with the code.

The banding exists because monitors do not have enough colors to represent the subtle change. You are trying to change 10% opacity over a large area which is not possible with most monitors.

You can determine this is a monitor issue by switching screens. Depending on the quality and the pixel density of the monitor, you will see slightly different results. Some browsers use dithering, which reduces the color banding with the tradeoff of pixelation.

The only way to work around the problem is to introduce more color variation like Prince was getting at.

An answer from another post does a great job of explaining this concept. It's worth a read, but I will quote the solutions to save people a click. https://stackoverflow.com/a/11274627/6794536

If you want to make it less obvious with your current 24-bit color
monitor, you can:

  • Change your design to introduce a subtle color shift into your
    gradient (e.g. from dark blue to gray-green). This causes different
    RGB channels bits can transition at different times, breaking up your
    bands into a smaller differentiated colors.

  • Change your design to increase your dynamic range (e.g. from pure
    white to pure black) so that you have more color bars to work with.

  • Change your design to reduce the overall distance that the gradient
    occurs over, reducing the widths of the bands.


…or some combination of the above.

I implemented this strategy, but it is not perfect. If you really want to get rid of color banding, you will have to make other tradeoffs. For example, you may not be able to use pure black.

<div style="position:absolute; z-index:1; margin:15px;             width:640px; height:640px;             background-color:#0c0c26">
<svg id="svgEa" style="width:100%; height:100%;" viewBox="-5000 -5000 10000 10000" preserveAspectRatio="xMidYMid meet" clip-path="url(#svgEaClip)" transform="scale(1.0,1.0)" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- NOTE: All internal units are in KM (or %) --> <defs id="defsEa"> <clipPath id="svgEaClip"> <rect width="100%" height="100%" /> </clipPath> <linearGradient id="lgdEaSphere"> <stop style="stop-color:#ffffff;stop-opacity:1.00;" offset="0.00" id="stopEarthCenter" /> <stop style="stop-color:#dfffef;stop-opacity:1.00" offset="0.30" id="stopEarthInner" /> <stop style="stop-color:#91ffc8;stop-opacity:1.00" offset="0.31" id="stopEarthMid" /> <stop style="stop-color:#00A064;stop-opacity:1.00" offset="0.95264" id="stopEarthOuter" /> <stop style="stop-color:#44ffff;stop-opacity:0.66" offset="0.95264" id="stopAirInner" /> <stop style="stop-color:#44ffff;stop-opacity:0.10" offset="1.00" id="stopAirOuter" /> </linearGradient> <radialGradient id="rgdEaSphere" xlink:href="#lgdEaSphere" gradientUnits="userSpaceOnUse" cx="0" cy="0" fx="0" fy="0" r="3339.05" /> <linearGradient id="lgdEaNightSide" x1="0%" y1="0%" x2="0%" y2="100%" spreadMethod="pad"> <stop style="stop-color:#00033e;stop-opacity:0.7;" offset="0.00" id="stopEaMidnight"></stop> <!-- this stop seems to cause the artifact --> <stop style="stop-color:#090d24;stop-opacity:0.6;" offset="0.99" id="stopEaDusk"></stop> <stop style="stop-color:#000;stop-opacity:0.5;" offset="1.00" id="stopEaTerminator"></stop> </linearGradient> </defs> <g id="gEaAll" transform="scale(1.2,1.2)" > <g id="gEaSunFacing" > <!-- contains everything that stays oriented with the Sun --> <circle id="cEarthAir" cx="0" cy="0" r="3339.05" style="display:inline;fill-opacity:1;fill:url(#rgdEaSphere)" /> <!-- overlay to give Earth a night side. --> <path id="pNight" style="stroke:none; fill:url(#lgdEaNightSide)" d="M -3189.05,0 A 3189.05,15945.25 0 1,1 3189.05,0 Z" /> </g> </g> </svg>
</div>


Related Topics



Leave a reply



Submit