gradient

Swift: gradient on a cell of a tableview

本秂侑毒 提交于 2019-12-31 05:23:04
问题 On tableView's cells, I'm trying to define a gradient with the following Swift code: func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! { var cell:UITableViewCell = self.tableView?.dequeueReusableCellWithIdentifier("cell") as UITableViewCell cell.backgroundColor=UIColor.clearColor() let gradient : CAGradientLayer = CAGradientLayer() var arrayColors:Array<AnyObject> = [UIColor.blackColor().CGColor, UIColor.whiteColor().CGColor] gradient

CSS: Gradient text colour?

社会主义新天地 提交于 2019-12-31 01:49:05
问题 I'm trying to get some text to have a gradient colour, but I haven't a clue how. I'm trying to get it like this: The only thing I have tried is -webkit-mask , but I couldn't get that working how I wanted it to. The other thing would be -webkit-gradient in the color property - is that possible? Cross browser compatibility is fairly important, but not the end of the world. I'd prefer the text to be a solid colour in IE than to convert the entire thing into an image (there is quite a bit of text

parse css gradient rule with Javascript regex

大兔子大兔子 提交于 2019-12-31 01:27:30
问题 in my css file I have gradient rule, like this: background-image:linear-gradient(to right, #FF0000 0%, #00FF00 20px, rgb(0, 0, 255) 100%); I want to get all parts of this string. Expected output is: linear-gradient to right #FF0000 0%, #00FF00 20px, rgb(0, 0, 255) 100% it was too difficult for me to work on whole string so I decided to split it into parts. linear-gradient .*gradient[^\(]? colors rgb ?\([ 0-9.%,]+?\)|#[0-9a-fA-F]{3,6}\s[0-9]{1,3}[%|px]|#[0-9a-fA-F]{3,6}|(aqua|black|blue

keras/tensorflow model: gradient w.r.t. input return the same (wrong?) value for all input data

帅比萌擦擦* 提交于 2019-12-30 16:17:09
问题 Given a trained keras model I am trying to compute the gradient of the output with respect to the input. This example tries to fit the function y=x^2 with a keras model composed by 4 layers of relu activations, and compute the gradient of the model output with respect to the input. from keras.models import Sequential from keras.layers import Dense from keras import backend as k from sklearn.model_selection import train_test_split import numpy as np import tensorflow as tf # random data x = np

Separate animations work, Storyboard doesn't. Why?

≯℡__Kan透↙ 提交于 2019-12-30 11:39:50
问题 EDIT 1 : In order to satisfy "Complete, Minimal And Verifiable" Example Requirement TL:DR; Storyboard doesn't animate at all. Why? I am attempting to create a storyboard which will animate the offsets of all the gradient stops within a gradient, shifting them from the left to the right. I'm certain this is just a stupid syntax or argument error or something someplace on my part but I can't find it. This is the XAML : <Window x:Class="GradientShifting.MainWindow" xmlns="http://schemas

Separate animations work, Storyboard doesn't. Why?

那年仲夏 提交于 2019-12-30 11:39:47
问题 EDIT 1 : In order to satisfy "Complete, Minimal And Verifiable" Example Requirement TL:DR; Storyboard doesn't animate at all. Why? I am attempting to create a storyboard which will animate the offsets of all the gradient stops within a gradient, shifting them from the left to the right. I'm certain this is just a stupid syntax or argument error or something someplace on my part but I can't find it. This is the XAML : <Window x:Class="GradientShifting.MainWindow" xmlns="http://schemas

AS3: beginGradientFIll() doesn't make me a gradient!

*爱你&永不变心* 提交于 2019-12-30 11:29:28
问题 I'm trying to render a circle with a radial gradient but I can't seem to figure it out. var bkgdGrad:Shape = new Shape(); bkgdGrad.graphics.beginGradientFill(GradientType.RADIAL, [0x0000FF, 0x00FF00], [1, 1], [0, 255],null,"pad"); bkgdGrad.graphics.drawCircle(0,0,r+200); bkgdGrad.graphics.endFill(); this.addChild(bkgdGrad); The above code renders a solid green circle for me. If I change the array after the colors to [1,0] (the alpha array) I get a transparent fill. I can't seem to get flash

Canvas gradient performance

断了今生、忘了曾经 提交于 2019-12-30 10:57:05
问题 I am currently programming a little game using canvas. For the game I need some kind of fog which hides the most part of the map and only a small area around the player should be visible. Therfor I use a second canvas to overlay the one where the game takes place and fill it with a gradient (from transparent to black): function drawFog(){ fogc.clearRect(0,0,700,600); // Create gradient var grd=fogc.createRadialGradient(player.getPosX(),player.getPosY(),0,player.getPosX(),player.getPosY(),100)

How to make gradient border of an image using java?

爱⌒轻易说出口 提交于 2019-12-30 04:50:08
问题 How can I make an image border as gradient. I googled a lot, but didn't find correct suggestion. Any one can help me... Any suggestion please... 回答1: This is an interesting one. I first thought that there should be a simple solution, using some Graphics#drawRoundRect call with the appropriate Paint , but it's not sooo simple. However, one solution is implemented in the following example: The image is painted as-it-is into a new image. Then the edges and corners are painted. These consist of

Defining XML Parent Style of Gradient / Shape / Corners

半世苍凉 提交于 2019-12-30 03:20:10
问题 How can I define an easily reusable base shape (or gradient, or corners) in XML? I have a dozen or so drawable gradients that will be the same other than the start and end colors. I was hoping to define the identical stuff somewhere else and have an XML file for each different gradient that only defined the start and end colors. Is that possible? This is the base: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"