rgba

ValueError: Invalid RGBA argument: What is causing this error?

允我心安 提交于 2019-11-30 17:44:20
问题 I am trying to create a 3D colored bar chart using ideas from: this stackoverflow post. First I create a 3D bar chart with the following code: import numpy as np import matplotlib.colors as colors import matplotlib.cm as cm import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D samples = np.random.randint(91,size=(5000,2)) F = np.zeros([91,91]) for s in samples: F[s[0],s[1]] += 1 fig = plt.figure() ax = fig.add_subplot(111, projection='3d') x_data, y_data = np.meshgrid( np

Getting and setting the RGB / RGBA value of a pixel in a CCSprite (cocos2d-x)

孤者浪人 提交于 2019-11-30 09:59:18
Why do I need this? Basically I need to turn a color image into gray-scale. Including a gray-scale version of the image could be a solution, but space is tight in my situation - I don't want my APK to be too big. Besides, I would like to work on the pixels for some effects too. Again, this is to make the APK smaller. I have found getPixel setPixel from CCTexture2D and Getting image's pixel RGBA , but I would like something more simple. Any help is appreciated. Thank you! Here is my solution for you : 1.First make a CCImage version of your image: I) from File : CCImage *img= new CCImage(); img-

IE8 gradient filter not working if a background color exists

倾然丶 夕夏残阳落幕 提交于 2019-11-30 02:06:29
I'm trying to use the following CSS styles. They are working on most browsers, including ie7. However in ie8, the transparent background does not show and instead I get the background color which I would like to leave set as a fallback color. section.rgba{ background-color: #B4B490; background-color: rgba(200, 0, 104, 0.4); filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#99B4B490',EndColorStr='#99B4B490'); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#99B4B490',EndColorStr='#99B4B490')"; zoom: 1 } I would like to be able to get this to work without

CSS RGBA border / background alpha double

雨燕双飞 提交于 2019-11-30 02:02:47
I'm working on a website that has a lot of transparency involved, and I thought I would try to build it entirely in RGBA and then do fallbacks for IE. I need a "facebox" style border effect, where the outer border is rounded and is less opaque than the background of the box it surrounds. The last example from http://24ways.org/2009/working-with-rgba-colour seems to suggest that it's possible, but I can't seem to get it to work. When I try the following: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http:/

Getting and setting the RGB / RGBA value of a pixel in a CCSprite (cocos2d-x)

∥☆過路亽.° 提交于 2019-11-29 14:41:18
问题 Why do I need this? Basically I need to turn a color image into gray-scale. Including a gray-scale version of the image could be a solution, but space is tight in my situation - I don't want my APK to be too big. Besides, I would like to work on the pixels for some effects too. Again, this is to make the APK smaller. I have found getPixel setPixel from CCTexture2D and Getting image's pixel RGBA, but I would like something more simple. Any help is appreciated. Thank you! 回答1: Here is my

CSS rgba transparency bug in Chrome?

混江龙づ霸主 提交于 2019-11-29 13:24:36
Just placing a DIV with white background and any opacity value: background-color: rgba(255, 255, 255, .5); over a white (255x3) background. Actually DIV's background will be 254/254/254. This happen only in Chrome. FF/IE/Opera/Safari is ok. Bug? Möhre This looks like a bug! I can confirm this misbehaviour. Got it also by using background: rgba(255,255,255,0.1) . More weird: the calculated style says background-color: rgba(255, 255, 255, 0.0980392) It is hard to see on cheaper displays using TN technology, but still possible to screenshot and measure with e.g. Photoshop. This question is

Fast Converting RGBA to ARGB

感情迁移 提交于 2019-11-29 12:25:56
I am trying to convert a rgba buffer into argb, is there any way to improve the next algorithm, or any other faster way to perform such operation? Taking into account that the alpha value is not important once in the argb buffer, and should always end up as 0xFF. int y, x, pixel; for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { pixel = rgbaBuffer[y * width + x]; argbBuffer[(height - y - 1) * width + x] = (pixel & 0xff00ff00) | ((pixel << 16) & 0x00ff0000) | ((pixel >> 16) & 0xff); } } I will focus only in the swap function: typedef unsigned int Color32; inline Color32

ChartJS canvas not displaying rgba colors in IE, Safari and Firefox

倖福魔咒の 提交于 2019-11-29 06:14:21
Im using ChartJS to display some data but it's not rendering the canvas element correctly in IE, Firefox and Safari. My guess is that the background color property lacks any of the used prefixes for the other browser since it works fine in Chrome. Anyone else had this issue? Chrome : Firefox, Safari and IE: The code: window.onload = function() { var ctx = document.getElementById("canvas"); var myChart = new Chart(ctx, { type: 'line', data: { labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug"], datasets: [{ label: '# of Value', data: [12, 19, 3, 5, 2, 3, 10, 29], backgroundColor: [

IE8 gradient filter not working if a background color exists

旧街凉风 提交于 2019-11-28 23:00:52
问题 I'm trying to use the following CSS styles. They are working on most browsers, including ie7. However in ie8, the transparent background does not show and instead I get the background color which I would like to leave set as a fallback color. section.rgba{ background-color: #B4B490; background-color: rgba(200, 0, 104, 0.4); filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#99B4B490',EndColorStr='#99B4B490'); -ms-filter: "progid:DXImageTransform.Microsoft.gradient

Convert RGBA to HEX

不想你离开。 提交于 2019-11-28 17:32:48
Given a css color value like: rgba(0, 0, 0, 0.86) How do I convert that to a RGB hex value that takes the alpha component into account, assuming a white background? Since alpha value both attenuates the background color and the color value, something like this could do the trick: function rgba2rgb(RGB_background, RGBA_color) { var alpha = RGBA_color.a; return new Color( (1 - alpha) * RGB_background.r + alpha * RGBA_color.r, (1 - alpha) * RGB_background.g + alpha * RGBA_color.g, (1 - alpha) * RGB_background.b + alpha * RGBA_color.b ); } (Try it interactively: http://marcodiiga.github.io/rgba-to