gradient

ggplot: How to produce a gradient fill within a geom_polygon

大城市里の小女人 提交于 2019-11-29 10:05:06
This should be fairly easy but I can't find my way thru. tri_fill <- structure( list(x= c(0.75, 0.75, 2.25, 3.25), y = c(40, 43, 43, 40)), .Names = c("x", "y"), row.names = c(NA, -4L), class = "data.frame",Integrated=NA, Related=NA) # install.packages("ggplot2", dependencies = TRUE) require(ggplot2) ggplot(data=tri_fill,aes(x=x, y=y))+ geom_polygon() + scale_fill_gradient(limits=c(1, 4), low = "lightgrey", high = "red") What I want is a gradient along the x-axis, but with the above I only get a legend with a gradient and the polygon with solid fill. Here is a possible solution for when you

How do I make a gradient opacity in an image?

两盒软妹~` 提交于 2019-11-29 08:32:09
How do I make an image fade in qml? How do I achieve this effect? here I attach the image of how I want it to look A possible solution is to use OpacityMask with a LinearGradient as source import QtQuick 2.9 import QtQuick.Window 2.2 import QtGraphicalEffects 1.0 Window { visible: true width: 600 height: 600 title: qsTr("Hello World") Image { id: input source: "input.jpg" anchors.fill: parent OpacityMask { source: mask maskSource: input } LinearGradient { id: mask anchors.fill: parent gradient: Gradient { GradientStop { position: 0.2; color: "transparent"} GradientStop { position: 0.5; color:

How to render a radial gradient onto a new UIImage on an iphone

柔情痞子 提交于 2019-11-29 08:31:51
Just wondering how to render a radial gradient (point > circle) onto a new UIImage (iphone). I saw the following: http://developer.apple.com/library/ios/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_shadings/dq_shadings.html And it made me think i need to use CGShadingRef or CGGradientRef, and use UIImage's 'imageWithCGImage' constructor to go from the CG* to a UIImage... but i can't figure out how. Any suggestions greatly appreciated! You should read about Graphics Contexts in the same document as the section you linked. All drawing happens in a graphics context. If you

Can I have a horizontal multiple colour gradient on text using CSS3 / HTML 5?

好久不见. 提交于 2019-11-29 08:03:14
I'm trying to replace a sIFR based flash effect currently used on a website with CSS 3 styling. I have the text gradient effect working well using CSS 3 but the original sIFR implementation had multiple colours rather than just a simple gradient of one colour to the next. Can someone provide me an example of styling a text element such as an H2 using multiple colours along the horizontal axis? Thanks, Brian. Here is sample SVG code - tested with FF4, Safari 5, and Chrome. Note that you have to serve this as an XHTML page for Safari to render it. This should also work with IE9 but I haven't

Gradient alpha fade out effect with CSS 3

∥☆過路亽.° 提交于 2019-11-29 07:38:48
问题 I would like to know if it would be possible to replicate the effect like the bottom of the Top Tweets list with pure CSS? http://www.twitter.com 回答1: Yes you can! Taking advantage of RGBa colors and CSS3 gradients, we can apply the following styles to an element and have a fading semi-transparent background: Mozilla: background: -moz-linear-gradient(top, rgba(255,255,255,0), rgba(255,255,255, 1)); Webkit: background: -webkit-linear-gradient(top, rgba(255,255,255,0), rgba(255,255,255, 1));

Drawing a Bitmap to a Canvas with an alpha gradient

独自空忆成欢 提交于 2019-11-29 07:10:54
I'd like to draw a Bitmap on a Canvas , with a (linear) alpha gradient applied. The important point is that I don't want to overlay the image with any other color; the background (coming from the View s behind the View that I'd be drawing this Canvas to) should just "shine through". To illustrate, my goal would be something like this (the checkerboard pattern represents the View behind) One would think that I could do something like this: Bitmap bitmap = ...; Paint paint = new Paint(); paint.setShader(new LinearGradient(0, 0, 100, 0, FROM, TO, Shader.TileMode.CLAMP)); canvas.drawBitmap(bitmap,

Programmatically create textview background from drawable in Android

孤者浪人 提交于 2019-11-29 06:37:15
I have to set the background programmatically on Android TextView I have using below code. it's not working and also its gave me nullpointerexception error. best_deals = (TextView) findViewById(R.id.bestdeals); best_deals.setBackground(getResources().getDrawable( R.drawable.headerradius)); but I have to put these best_deals.setTextColor(Color.parseColor("#be2351")); means it's working what's wrong in above code? This is my header_redius.xml : <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" android:padding="10dp"> <solid android:color="#000000"/>

Gradient color in a treemap for D3

前提是你 提交于 2019-11-29 05:21:57
First of all this is different from the previous question asked in the posts, for what i am trying to achieve is a gradient for the entire treemap in d3, like what we have in google treemaps. I am trying to implement http://bost.ocks.org/mike/treemap/ and working on the same, but in d3 i was trying to have a color gradient in it. Currently I am doing this by color = d3.scale.category20c() and .style("fill", function(d) { return color(d.name)}) on my svg element. But i want to have a gradiant color more like a heatmap, so as to make larger boxes in treemap more green and smaller boxes less

Linear Gradient Brush Fade WPF

徘徊边缘 提交于 2019-11-29 04:26:43
I have a brush that colors the background of a header. I like the way the brush looks but would like it to fade to transparent in the bottom third. Any ideas how to do this? <LinearGradientBrush x:Key="HeaderBackgroundBrush" EndPoint=".5,1" StartPoint="1,0"> <GradientStop Color="#006699" Offset="1"/> <GradientStop Color="#80A8CC" Offset="0.5"/> </LinearGradientBrush> I'm not sure you can do it by working only at the brush level, however you could apply an OpacityMask to your control: <LinearGradientBrush x:Key="HeaderBackgroundOpacityMask" StartPoint="0,0" EndPoint="0,1"> <GradientStop Color="

CSS3 White to Transparent Gradient

你。 提交于 2019-11-29 03:58:12
I'm using CSS3 and RGBA to create a white-to-transparent gradient: div { background-image: -moz-linear-gradient(left, rgba(255, 255, 255, 1), rgba(0, 0, 0, 0)); background-image: -ms-linear-gradient(left, rgba(255, 255, 255, 1), rgba(0, 0, 0, 0)); background-image: -webkit-gradient(linear, 0 0, 100% 0, from(rgba(255, 255, 255, 1)), to(rgba(0, 0, 0, 0))); background-image: -webkit-linear-gradient(left, rgba(255, 255, 255, 1), rgba(0, 0, 0, 0)); background-image: -o-linear-gradient(left, rgba(255, 255, 255, 1), rgba(0, 0, 0, 0)); background-image: linear-gradient(left, rgba(255, 255, 255, 1),