linear-gradients

Apply vertical alpha gradient to UITableView

喜欢而已 提交于 2019-12-17 22:56:02
问题 I'm new to iOS development and am trying to learn Swift. I'd like to apply a vertical alpha gradient to a UITableView, but am having some trouble. Originally following this SO post, I did the following: var gradientMaskLayer:CAGradientLayer = CAGradientLayer() gradientMaskLayer.frame = myTableView.bounds gradientMaskLayer.colors = [UIColor.clearColor().CGColor, UIColor.blackColor().CGColor] gradientMaskLayer.locations = [0.0, 0.05] myTableView.layer.mask = gradientMaskLayer After getting the

Webkit linear gradient stops render incorrectly

会有一股神秘感。 提交于 2019-12-17 19:39:33
问题 I have come across a weird problem in webkit browsers (Chrome, Opera). Test case: http://sample.easwee.net/gradient-bug/ (check in Chrome or latest Opera) I have two columns wrapped by a container. I'm applying a CSS gradient to create backgrounds for this two columns. The color stop is set to 66% and columns have the same 66% width (using padding to offset the right column). It renders correctly in Firefox - both column layout and gradient stop point match, but in webkit based browsers the

Multi-color linear gradient in WinForms

牧云@^-^@ 提交于 2019-12-17 15:45:06
问题 How to create multi-color linear gradient in WinForms? System.Drawing.Drawing2D.LinearGradientBrush allows only two colors. 回答1: 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

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

对着背影说爱祢 提交于 2019-12-17 14:56:52
问题 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{

Gradient text color

谁说我不能喝 提交于 2019-12-17 04:57:29
问题 Is there a generator , or an easy way to generate text like this but without having to define every letter So something like this: .rainbow { background-image: -webkit-gradient( linear, left top, right top, color-stop(0, #f22), color-stop(0.15, #f2f), color-stop(0.3, #22f), color-stop(0.45, #2ff), color-stop(0.6, #2f2),color-stop(0.75, #2f2), color-stop(0.9, #ff2), color-stop(1, #f22) ); background-image: gradient( linear, left top, right top, color-stop(0, #f22), color-stop(0.15, #f2f),

How to fix linear-gradient on background image with opacity on mobile and desktop safari

六眼飞鱼酱① 提交于 2019-12-14 03:03:26
问题 In regards to these two questions: How to do equivalent of a linear-gradient with opacity on a seamless background image in CSS How to apply equivalent of linear-gradient with opacity on edges of non-repeated image It is showing up like this on desktop and mobile safari: The question is how to fix this and get it working on mobile and desktop safari. 来源: https://stackoverflow.com/questions/57246358/how-to-fix-linear-gradient-on-background-image-with-opacity-on-mobile-and-deskto

How to mask Bitmap with LinearGradient shader properly?

落爺英雄遲暮 提交于 2019-12-14 00:19:55
问题 I'm trying to mask Bitmap with gradient alpha at bottom. Gradient size are fixed and independed of Bitmap size. But it draws incorrect: bottom of gradient at top, than top. What's wrong? There is sample code: final int GRADIENT_HEIGHT = 32; public Bitmap addGradient(Bitmap src) { int w = src.getWidth(); int h = src.getHeight(); Bitmap overlay = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(overlay); canvas.drawBitmap(src, 0, 0, null); Paint paint = new Paint()

CSS Transition with Border Radius and Linear Gradient

[亡魂溺海] 提交于 2019-12-13 16:58:13
问题 Given my CodePen https://codepen.io/scottmgerstl/pen/MpMeBy this is my image layout in question <span class="profile-pic-wrapper"> <a href="https://www.google.com" target="_blank"> <img class="profile-pic" src="http://i-cdn.phonearena.com/images/article/67689-image/Video-shows-Super-Mario-64-HD-playing-on-the-Apple-iPhone-6.jpg"/> <span class="profile-pic-overlay"> <span class="social-icon">View Profile</span> </span> </a> </span> Description I am trying to use a CSS transition on a linear

Android: How to draw a two dimensional gradient

我只是一个虾纸丫 提交于 2019-12-13 12:41:16
问题 I am looking to draw a gradient like this using Android's Canvas : In the horizontal direction there is a gradient of two colors (red and blue). Then in the vertical direction there is a gradient of transparency (allowing the red and blue to show) to nothing (the absence of all color?). I found this link on SO here which is close to what I want. But I cannot figure out how to make the bottom transparent. How can this be accomplished in Android? 回答1: Those sort of "custom" gradients can

Creating Rainbow Gradient CreateJS

╄→尐↘猪︶ㄣ 提交于 2019-12-13 09:11:33
问题 ****Edit*** I have figured out the issue my next question is, why is that if I change the first X point and leave the others at 0 that I get my desired gradient effect? function init(){ var canvas = document.getElementById("easel"), SIZE = 250, centerX = canvas.width/2, centerY = canvas.height/2; //////////////////////////////////// ///////// Rainbow Arc ///////////// ////////////////////////////////// var newStroke = new createjs.Shape(); //newStroke.graphics.beginStroke("#000"); newStroke