rgba

CSS: lighten an element on hover

百般思念 提交于 2019-12-02 19:57:38
Assuming an element is at 100% saturation, opacity, etc... how can I have its background become slightly lighter when it is hovered? The use case is that I'm allowing a user to hover over any element on a page. I don't want to go around determining each colors equivalent at 80% opacity. One method is to change the opacity: 0.4 but I only want the background to change. It's a long time ago but you can do something like this: .element { background-color: red; } .element:hover { box-shadow: inset 0 0 100px 100px rgba(255, 255, 255, 0.1); } You can change the 100px into a number you want. I took a

LESScss converting rgba to hex? how to nest color variables into a mixin?

北城以北 提交于 2019-12-02 16:46:28
Does LESScss convert all rgba colors to hex values? I am trying to create a mixin, say, .color, that allows you to pass in a color variable previously defined, and I want it to be in rgba. this doesn't work, but here's the idea: .bgcolor(@colorvariable,@alpha) { background-color: @colorvariable + rgba(0, 0, 0, @alpha); } Where @colorvariable would be, @blue: rgb(17,55,76); or @green: rgb(125,188,83); etc. I want to define a bunch of these variables, and then be able to pass them in to .bgcolor or .color mixin and change the alpha transparency on the fly. I feel like this should be possible,

Sass - Converting Hex to RGBa for background opacity

早过忘川 提交于 2019-12-02 13:51:44
I have the following Sass mixin, which is a half complete modification of an RGBa example : @mixin background-opacity($color, $opacity: .3) { background: rgb(200, 54, 54); /* The Fallback */ background: rgba(200, 54, 54, $opacity); } I have applied $opacity ok, but now I am a stuck with the $color part. The colors I will be sending into the mixin will be HEX not RGB. My example use will be: element { @include background-opacity(#333, .5); } How can I use HEX values within this mixin? hopper The rgba() function can accept a single hex color as well decimal RGB values. For example, this would

Problem reconstituting UIImage from RGBA pixel byte data

杀马特。学长 韩版系。学妹 提交于 2019-12-02 09:10:44
I need to create 12 coloured images from a single greyscale image ( red orange yellow etc ) Source image is actually a PNG, RGBA: I'm using a library I found ( https://github.com/PaulSolt/UIImage-Conversion/ ) to break the UIImage into a RGBA byte array which I then process pixel by pixel, and use the same library to reconstitute a new UIImage. This is my code: - (UIImage*) cloneWithTint3: (CGColorRef) cgTint { enum { R, G, B, A }; // - - - assert( CGColorGetNumberOfComponents( cgTint ) == 4 ); const float* tint = CGColorGetComponents( cgTint ); // - - - int w = self.size.width; int h = self

Android Renderscript - Rotate YUV data in Renderscript

故事扮演 提交于 2019-12-02 08:08:15
Based on the discussion I had at Camera2 api Imageformat.yuv_420_888 results on rotated image , I wanted to know how to adjust the lookup done via rsGetElementAt_uchar methods so that the YUV data is rotated by 90 degree. I also have a project like the HdrViewfinder provided by Google. The problem is that the output is in landscape because the output surface used as target surface is connected to the yuv allocation which does not care if the device is in landscape or portrait mode. But I want to adjust the code so that it is in portrait mode. Therefore, I took a custom YUVToRGBA renderscript

RGBA format HEX into RGB format HEX? PHP

假如想象 提交于 2019-12-01 14:20:44
I want to convert back and forth between RGBA-formated HEX colors (like 0xFF0000FF ) and RGB-formated HEX colors (like 0xFF0000 ) in PHP. How can I do this? How about these: function rgbaToRgb ($rgba, $blend = 0xFFFFFF) { return (($rgba >> 8)*($rgba & 0xFF)/0xFF) * ($blend / 0xFFFFFF); } function rgbToRgba ($rgb) { return ($rgb << 8) | 0xFF; } $blend in the first is effectively a background color to blend with. Edit: fix due to not enough space in ints ruining RGBA. RGBA is now handled as a four part array. RGB remains a number.: function rgbaToRgb ($rgba, $blend = 0xFFFFFF) { $rbg = array(

Java rotate image turns part of background black

江枫思渺然 提交于 2019-12-01 14:13:47
When I try to rotate an image it appears that a part of the background turns black (my images are transparents) Background white Part of background turns black Here's the code that rotate the image : public BufferedImage rotate(int height, int width, BufferedImage originalImg, int angle) { BufferedImage rotateImage = null; try { rotateImage = new BufferedImage(height, width, BufferedImage.TYPE_INT_RGB); AffineTransform a90 = AffineTransform.getRotateInstance(Math.toRadians(angle), height / 2, width / 2); AffineTransformOp op90 = new AffineTransformOp(a90, AffineTransformOp.TYPE_BILINEAR); op90

Create and write paletted RGBA PNG using NSImage

ぐ巨炮叔叔 提交于 2019-12-01 14:08:43
I'm trying to create paletted PNG image (8-bit per pixel) that uses RGBA palette (32-bit per palette entry) using Cocoa framework*. I've tried few combinations for [NSBitmapImageRep initWithBitmapDataPlanes:…] method. It seems to create appropriate bitmap for bitsPerSample:2 bitsPerPixel:8 . However, when I try to write such bitmap with [NSBitmapImageRep representationUsingType:NSPNGFileType…] I get: libpng error: Invalid bit depth for RGBA image If I try other bit depths, then I get 32-bit per pixel (non-paletted) image. *) I know I could just use libpng , but that's not an answer I'm looking

Create and write paletted RGBA PNG using NSImage

99封情书 提交于 2019-12-01 12:43:47
问题 I'm trying to create paletted PNG image (8-bit per pixel) that uses RGBA palette (32-bit per palette entry) using Cocoa framework*. I've tried few combinations for [NSBitmapImageRep initWithBitmapDataPlanes:…] method. It seems to create appropriate bitmap for bitsPerSample:2 bitsPerPixel:8 . However, when I try to write such bitmap with [NSBitmapImageRep representationUsingType:NSPNGFileType…] I get: libpng error: Invalid bit depth for RGBA image If I try other bit depths, then I get 32-bit

Java rotate image turns part of background black

坚强是说给别人听的谎言 提交于 2019-12-01 12:21:58
问题 When I try to rotate an image it appears that a part of the background turns black (my images are transparents) Background white Part of background turns black Here's the code that rotate the image : public BufferedImage rotate(int height, int width, BufferedImage originalImg, int angle) { BufferedImage rotateImage = null; try { rotateImage = new BufferedImage(height, width, BufferedImage.TYPE_INT_RGB); AffineTransform a90 = AffineTransform.getRotateInstance(Math.toRadians(angle), height / 2,