gradient

three.js skydome with gradient

那年仲夏 提交于 2019-12-08 01:28:31
问题 I would like to add a sphere with a 2d gradient as texture to create a skydome. I read that in openGL this is often solved by rendering the skybox without depthtest in an additonal pass. I disabled depthTest on my sphere so everything else is drawn in front of it, it's kinda giving me the disired effect but depending on the camera angle it clips through other objects in my scene. I was looking at several examples which make use of THREE.EffectComposer and a second scene, I may be completely

HTML5 Canvas - Banding with low alpha?

孤人 提交于 2019-12-07 23:40:03
问题 Introduction I'm currently developing a small drawing application similar to MugTug's Sketchpad. There's one pretty annoying issue I haven't managed to get around yet, though. Drawing Algorithm My basic draw algorithm is similar to the one used by MugTug. Basically it just stamps images using drawImage while the user is drawing. There's one serious handicap. The algorithm begins to fail with low alpha. You can see this easily in the MugTug's tool by setting brush settings in the following way

Blend transparent gradient with an image using php GD library

自古美人都是妖i 提交于 2019-12-07 21:12:56
问题 I try to render gradient on top of an image it need to be from full color to transparent, here is my code. I get black image and if I put start more then 0 I got white gradient but no image. the output image is 338x100 px but the input image need to be aligned to right if the image is narrower. function hex2rgb($hex) { $rgb[0] = hexdec(substr($hex, 0, 2)); $rgb[1] = hexdec(substr($hex, 2, 2)); $rgb[2] = hexdec(substr($hex, 4, 2)); return $rgb; } function int2rgb($color) { $result[] = ($color

Gradient color for each category to generate a heatmap table using ggplot in R

一个人想着一个人 提交于 2019-12-07 17:04:16
问题 I am trying to generate a heatmap table using ggplot in R . My data looks this: dt <- cbind(rbinom(1:10,100,0.9), rbinom(1:10,100,0.5), rbinom(1:10,100,0.2), rbinom(1:10,100,0.05) colnames(dt) <- c("A","B","C","D") I want to use different gradient colors for each category to emphasize the importance of each value. Since the range of values is large, the smaller number will be colored almost same. That's why, I want to use different colors. My code is here: library(dplyr) library(ggplot2)

Gradient Background that doesn't scale

早过忘川 提交于 2019-12-07 16:00:41
问题 I need to create a gradient that is 230dp high (i.e., not the whole screen), with the rest of the screen a solid color. I can't figure out how to do this -- everything I try ends up with the gradient expanding to fill the whole screen. My current XML looks like this: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:top="230dp"> <shape android:shape="rectangle" > <color android:color="#333333" /> </shape> </item>

How do I draw gradients of discrete integer values from 0-255 in WebGL without making a buffer for each color

自古美人都是妖i 提交于 2019-12-07 09:29:59
问题 Hello I am using Dartlang and WebGl to write a neural net visualization and I the neurons output ranges from 0-1. I want to display the neurons outputs as a function of color using a sampling depth of 255 values in the red spectrum. I have learned basic WegGL and I know that I need to bind a color to an array and then read it using a GPU program. My program draws red triangle for a neuron with output close to 1 and white for a neuron who's output is close to 0. My question is how do I draw

gradient on Gingerbread

风流意气都作罢 提交于 2019-12-07 07:25:32
问题 Updated I have a problem with gradient bitmaps on android 2.3. I read this great article and decode my bitmaps using next options: BitmapFactory.Options options = new BitmapFactory.Options(); options.inPreferredConfig = Bitmap.Config.ARGB_8888; options.inDither = true; And on android 2.2 everything is great, but on android 2.3 gradient artifacts remain even after that decoding. I run application from article on 2.3 with my bitmaps and all variants are bad: 16/32 bit, (not) dither and RBG_565,

Expo Linear Gradient transparent is showing up blackish

拜拜、爱过 提交于 2019-12-07 06:30:31
I'm trying to get a bottom to top white to transparent-white transition in my React Native screen using Expo Linear Gradients: https://docs.expo.io/versions/latest/sdk/linear-gradient.html I copied the second example and flipped it around, and made it white instead of black. But now the "transparent" the white is supposed to fade in to is darker that the white is, see below: The transparent actually is see through so that's good but is there a way to give it a white hue? Code here: <LinearGradient colors={[ 'transparent', 'rgba(255,255,255,0.8)']} style={{ position: 'absolute', left: 0, right:

Solid gradients not really solid? Don't have crisp edges at color stops

空扰寡人 提交于 2019-12-06 16:49:56
In CSS, this seems to be the easiest way to create solid looking gradients where colors end and start abruptly at color stops. Example - background-image:linear-gradient(to bottom, gray 100px, white 0); /*Let the browser decide*/ OR background-image:linear-gradient(to bottom, gray 100px, white 100px); /*Explicitly specify.*/ What happens is that a gradient is generated but it doesn't really have crisp edges where the colors meet. My assumption was that the code would result in gray stopping at 100px and white starting right after it. But it turns out that it's still a bit blurry. I have put

adding gradient to UIView in drawRect

天涯浪子 提交于 2019-12-06 15:57:55
I am trying to add a CAGradientLayer in my drawRect, the code is the following: - (void)drawRect:(CGRect)rect { CAGradientLayer *gradientOverlay = [CAGradientLayer layer]; CGColorRef grayColor = [UIColor colorWithRed:37/255.f green:37/255.f blue:37/255.f alpha:1.0].CGColor; CGColorRef blueColor = [UIColor colorWithRed:23.0/255.0 green:171.0/255.0 blue:219.0/255.0 alpha:1.0].CGColor; gradientOverlay.colors = [NSArray arrayWithObjects: (id) grayColor, (id) grayColor, (id) blueColor, nil]; gradientOverlay.locations = [NSArray arrayWithObjects: [NSNumber numberWithFloat:0], [NSNumber