hsl

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

Algorithm for Hue/Saturation Adjustment Layer from Photoshop

拟墨画扇 提交于 2019-12-02 17:19:26
Does anyone know how adjustment layers work in Photoshop? I need to generate a result image having a source image and HSL values from Hue/Saturation adjustment layer. Conversion to RGB and then multiplication with the source color does not work. Or is it possible to replace Hue/Saturation Adjustment Layer with normal layers with appropriately set blending modes (Mulitiply, Screen, Hue, Saturation, Color, Luminocity,...)? If so then how? Thanks I've reverse-engineered the computation for when the "Colorize" checkbox is checked . All of the code below is pseudo-code . The inputs are: hueRGB ,

Color Theory: How to convert Munsell HVC to RGB/HSB/HSL

大兔子大兔子 提交于 2019-12-02 16:56:52
I'm looking at at document that describes the standard colors used in dentistry to describe the color of a tooth. They quote hue , value , chroma values, and indicate they are from the 1905 Munsell description of color: The system of colour notation developed by A. H. Munsell in 1905 identifies colour in terms of three attributes: HUE, VALUE (Brightness) and CHROMA (saturation) [ 15 ] HUE (H): Munsell defined hue as the quality by which we distinguish one colour from another. He selected five principle colours: red, yellow, green, blue, and purple; and five intermediate colours: yellow-red,

RGB value to HSL converter

∥☆過路亽.° 提交于 2019-12-01 02:27:25
问题 Google maps api v3 allows "styles" to be applied to the map, including setting the color of various features. However, the color format it uses is HSL (or what seems like it): hue (an RGB hex string) lightness (a floating point value between -100 and 100) saturation (a floating point value between -100 and 100) (from the docs) I managed to find RGB to HSL converters online, but I am unsure how to specify the converted values in a way that google maps will accept. For instance, a typical HSL

Faster algorithm to change Hue/Saturation/Lightness in a bitmap

你说的曾经没有我的故事 提交于 2019-11-30 16:40:20
I am trying to filter a Bitmap image to increase or decrease Hue, Saturation, and Lightness values. My code is working perfectly, but it is slow . I am locking two bitmaps in memory, the original source and the current destination. The user can move various trackbar controls to modify each value which is then converted to an HSL value. For example, the values on the trackbar correspond to a range of -1.0 to 1.0. Each time an event is thrown that the trackbar value changed, I run a function which locks the destination bitmap and applies the HSL values with the source bitmap and then stores the

Does the .Net Color struct use an HSB or HSL colour space?

那年仲夏 提交于 2019-11-30 14:58:41
问题 As I understand it HSL and HSB colour spaces are very similar, both use the same 0-360 colour wheel for hue and the same 0-1 value for saturation. The one difference between them is that in the HSB model you have brightness, where 0 is black and 1 is the colour at full intensity, while in HSL you have lightness/luminosity, where 0 is still black but 1 is white. The .net Color struct uses the RGB space, but has GetHue() , GetSaturation() and GetBrightness() functions. The documentation here is

Does the .Net Color struct use an HSB or HSL colour space?

断了今生、忘了曾经 提交于 2019-11-30 12:43:18
As I understand it HSL and HSB colour spaces are very similar, both use the same 0-360 colour wheel for hue and the same 0-1 value for saturation. The one difference between them is that in the HSB model you have brightness, where 0 is black and 1 is the colour at full intensity, while in HSL you have lightness/luminosity, where 0 is still black but 1 is white. The .net Color struct uses the RGB space, but has GetHue() , GetSaturation() and GetBrightness() functions. The documentation here is confusing. For GetBrightness() : /// <summary>Gets the hue-saturation-brightness (HSB) brightness

Why does greyscale work the way it does?

折月煮酒 提交于 2019-11-30 06:13:27
My original question I read that to convert a RGB pixel into greyscale RGB, one should use r_new = g_new = b_new = r_old * 0.3 + g_old * 0.59 + b_old * 0.11 I also read, and understand, that g has a higher weighting because the human eye is more sensitive to green. Implementing that, I saw the results were the same as I would get from setting an image to 'greyscale' in an image editor like the Gimp. Before I read this, I imagined that to convert a pixel to greyscale, one would convert it to HSL or HSV, then set the saturation to zero (hence, removing all colour). However, when I did this, I

Converting from RGB to HSL with Objective C

◇◆丶佛笑我妖孽 提交于 2019-11-30 04:55:03
问题 I'm quite new to objective c but have been programming for a while. I started creating a function that would convert from RGB to HSL and back again but I get a feeling it is way too long and headed in the wrong direction. Does anyone know of a simple way to perform this conversion? 回答1: NSColor is missing in iPhone SDK. You can use this utility to convert from RGB to HSL space and back: https://github.com/alessani/ColorConverter 回答2: You can use NSColor , I think. CGFloat r, g, b, a, h, s, b,

Why does the CSS filter hue-rotate produce wierd results?

倾然丶 夕夏残阳落幕 提交于 2019-11-29 19:56:43
问题 I'm trying to emulate Photoshop's "Color Overlay" using CSS filters, and while doing so, found out the CSS filters operate on colors as consistently as an epileptic seizure. Consider the color #FF0000 . If we rotate its hue by 120deg , we should get #00FF00 , and by 240deg we should get #0000FF . This is the realm of sanity. Now let's enter CSS filters: body { font: bold 99px Arial } span { color: #F00; } .daltonics-wont-notice { -webkit-filter: hue-rotate(120deg); filter: hue-rotate(120deg);