gradient

How to improve the rendering of gradients and filled elements in Gnuplot?

青春壹個敷衍的年華 提交于 2019-12-01 07:32:47
I have noticed that Gnuplot produces ugly artefacts when dealing to filled elements. One instance is in the palette of the next figure: Another example is when using filledcurves between two curves defined from points in ASCII files. In this case, you can see that rather than a real solid fill between the lines, the area is filled with number of strips, that only become apparent after zooming quite a bit, but that has very strong impact when rastering the image to png or similar: This seems to be independent on the terminal. I have tried postscrip , pdfcairo and even tikz . Is there anything

Get element CSS3 background-color gradient with JS

眉间皱痕 提交于 2019-12-01 06:33:28
At the moment I use the following JS (jQuery) to find the background color (as rgb) of several other divs: $theColor = $(this).css("background-color"); It works perfectly, except with CSS3 gradients. As an example, I have the following css to make the background of a div look similar to a post-it note: background: #FFFAAD; /* old browsers */ background: -moz-linear-gradient(top, #FFFAAD 0%, #FFF47D 100%); /* firefox */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFFAAD), color-stop(100%,#FFF47D)); /* webkit */ background: gradient(linear, left top, left bottom,

Gradient direction computation

纵饮孤独 提交于 2019-12-01 06:16:58
I'm working on my task in computer vision course. One of sub-tasks is gradient direction computation based on image brightness. I've made a matrix bright[width][height] containing brightness values for every pixel of the image. And i have two such functions: double Image::grad_x(int x,int y){ if(x==width-1 || x==0) return bright[x][y]; return bright[x+1][y]-bright[x-1][y]; } double Image::grad_y(int x,int y){ if(y==height-1 || y==0) return bright[x][y]; return bright[x][y+1]-bright[x][y-1]; } EDIT: border check fixed I'm working with simple derivative, without using Sobel operator 'cause

How may I use 'inline' SVG gradient on an element like <line>?

梦想与她 提交于 2019-12-01 05:18:28
Is it possible to achieve this gradient without having to define it first under <defs> ? I'm working on a network map showing network load on links between devices (switches, routers ..). I draw this using SVG, but I don't want to define all gradients as the start (uplink) and end (downlink) color is already given to me from the back end system and accessible through template variables in our application. I wish to use inline-styles as it is much easier to do code wise as I don't have to keep track of thousands of link references and make sure I specify the right gradient for every link, as

How to improve the rendering of gradients and filled elements in Gnuplot?

柔情痞子 提交于 2019-12-01 05:09:09
问题 I have noticed that Gnuplot produces ugly artefacts when dealing to filled elements. One instance is in the palette of the next figure: Another example is when using filledcurves between two curves defined from points in ASCII files. In this case, you can see that rather than a real solid fill between the lines, the area is filled with number of strips, that only become apparent after zooming quite a bit, but that has very strong impact when rastering the image to png or similar: This seems

Browser handling of CSS “transparent” in gradients

北慕城南 提交于 2019-12-01 04:24:10
Although the CSS colors rgba(255,255,255,0) and rgba(0,0,0,0) are apparently the same, i.e. transparent , when being looked at as plain colors, they affect the intermediate colors in gradients: linear-gradient(left center, rgba(0,0,0,0), rgba(255,255,255,1)) This yields grey semitransparent tones between the two ends. Now my questions: Do browsers select the “right” color for transparent automatically or is it a fixed color (most likely “black transparent” or “white transparent”)? Is this different between browsers? Although the Color module states that transparent means the same as rgba(0, 0,

Maths for color gradient [closed]

半世苍凉 提交于 2019-12-01 04:03:50
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . Is any Maths for making a (simple) color gradient? I'm looking for simple methods of making a gradient. Not in a specific language. Just the maths of colors. 回答1: In general, a colour gradient is a linear function for easing from one colour to another. For instance, if you wanted to produce a gradient from red

Java 3 Color Gradient

房东的猫 提交于 2019-12-01 03:44:37
I have a JPanel , and I would like to paint a gradient within it. I have the code below, but that only paints a 2 color gradient. I would like to add a 3rd but don't know how. What I want is to have the top left of the panel as white, top right red, and both bottom corners black. What would I have to do to achieve this, something that looks like this: package pocketshop.util; import java.awt.Color; import java.awt.GradientPaint; import java.awt.Graphics; import java.awt.Graphics2D; import javax.swing.JPanel; public class ColorPicker extends JPanel{ public ColorPicker(){ repaint(); } @Override

Coloring a geom_histogram by gradient

大兔子大兔子 提交于 2019-12-01 03:34:11
问题 I'm trying to plot a geom_histogram where the bars are colored by a gradient. This is what I'm trying to do: library(ggplot2) set.seed(1) df <- data.frame(id=paste("ID",1:1000,sep="."),val=rnorm(1000),stringsAsFactors=F) ggplot(df,aes_string(x="val",y="..count..+1",fill="val"))+geom_histogram(binwidth=1,pad=TRUE)+scale_y_log10()+scale_fill_gradient2("val",low="darkblue",high="darkred") But getting: Any idea how to get it colored by the defined gradient? 回答1: Not sure you can fill by val

Simulating color stops in gradients for IE

落花浮王杯 提交于 2019-12-01 03:29:38
I want to give a div a gradient with multiple color-stops, which IE's filter property does not support. Anyone have a creative workaround to simulate the color stops in IE? I already thought of creating multiple divs right next to each other... anything else? Thanks! 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/ I'd recommend you to use a background image as a fallback for browsers (as Opera and IE) that don't support CSS gradients. user984003 Or use CSS3 PIE.