Are you using the WRONG color model in your CSS?

Are you using the WRONG color model in your CSS?

Kevin Powell

3 года назад

66,604 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@BohemianOnTheRoad
@BohemianOnTheRoad - 29.11.2023 15:44

love you mr. Powell from Bangladesh

Ответить
@VIBORARockbandES
@VIBORARockbandES - 30.05.2023 01:21

wow every day i learn something new Kevin thanks for sharing

Ответить
@iramimran3117
@iramimran3117 - 05.05.2023 18:05

Hi, Kevin how can choose the numbers in variable name 300,400 and 500 we can take any number or specific rule to select number with variables name.

Ответить
@ocxigin9220
@ocxigin9220 - 07.02.2023 22:09

Lol, I like the part you said when you say "if you write color picker in google you get a color picker". 😹

Ответить
@flowerofash4439
@flowerofash4439 - 30.01.2023 15:33

i feel like the saturation percentage is just how less grey smoke you want on your color

Ответить
@12chachachannel
@12chachachannel - 15.12.2022 10:28

The hex model is not bad at all, it is just not designed for human identification

Ответить
@jameshuisangkim
@jameshuisangkim - 20.11.2022 06:17

Not sure if this questions will be answered but, is there an advantage for using HSL vs. HSB? I'm a product designer and I design in HSB. I'm wondering if I should switch to HSL all together if there are clear advantages. Thanks in advance!

Ответить
@SomeNerdOutThere
@SomeNerdOutThere - 09.11.2022 03:20

I think the usefulness in hex codes would depend on one's background. I grew up doing low-level graphics work in C, so hex is quite intuitive to me. HSV I find baffling.

Ответить
@ZeeJohansen
@ZeeJohansen - 08.11.2022 14:25

That "for now" made me laugh so hard, I'm happy I'm watching this at home 🤣🤣

Ответить
@homercavazos
@homercavazos - 26.09.2022 19:23

Wow! changing the site I'm working on to HSL. Good stuff.

Ответить
@spicywasab
@spicywasab - 29.07.2022 01:18

The first one's probably a pretty light green blue-ish color (I know how to read hex colors since I'm 10 because of a video game's chat hidden feature)

I don't really know for hex color codes with alpha valued, but assuming the alpha value is at the end (5E), it should be somewhere around 30%, since 16/5 ≈ 30%

Ответить
@caigner
@caigner - 06.06.2022 14:21

Hi Kevin! I was wondering... Is it possible to colour a number based on its sign? Like: 1,2,3 are coloured black, but -3, -2, -1 are coloured red. I would love to see a pure CSS solution, no extra code on the server side, like adding an extra class to the number, if it is negative. Something like with even and odd, just with positive and negative.

Ответить
@kbcarte420
@kbcarte420 - 21.05.2022 02:21

I learned the vscode trick by mistake actually lol, game changer for sure. I used it most heavily for rgba to add alpha to colors designers give in hex. I'd still need to add the 'a' and a new parameter for the alpha but a game changer for sure to automajically convert between them all.

Ответить
@JulieVandebosch
@JulieVandebosch - 03.05.2022 14:34

I tried using hsla colors in my project. But when I check the computed values in the browser, I notice that the rgb and hex values differ from what I see in Figma when I convert the colors. Even the hsla value differs from what I put in my css code. Can you explain what's going on and how I make sure the correct values are being used?

Ответить
@vintprox
@vintprox - 17.04.2022 01:11

Glad you reminded me of how convenient HSL is. Not only it's enabling faster color inference without assistance from IDE, it's also more meaningful for anything that's going to extrapolate the color palette: fading long shadows, JavaScript customization, etc.

Ответить
@cmyk8964
@cmyk8964 - 16.04.2022 05:09

I prefer RGB because I’m a huge nerd and I have enough experience imagining R, G, and B values in my head as ratios. But when I’m designing a mockup on Inkscape, I use HSL when it’s more convenient, so that I can desaturate any color.

Ответить
@johnwayne8059
@johnwayne8059 - 13.04.2022 18:08

Great video!
Thank you Sir!👍👍👍

Ответить
@pablodv87
@pablodv87 - 12.04.2022 06:46

Your tweaking of the RGB values reminds me of Troy McClure squeezing an orange with his face...

Ответить
@lenarnie2973
@lenarnie2973 - 11.04.2022 19:20

Okay, so use it or no ?

Ответить
@cerpow
@cerpow - 09.04.2022 18:09

Hey Kevin, since safari supports P3 for so many years and there are many iPhone users, can you make a video about color() function best practices?

Ответить
@abdelghanialmasri6695
@abdelghanialmasri6695 - 18.02.2022 18:28

Thank you so much for your videos. I listened for all play list videos. Your videos organized my info. about CSS. Now CSS is very obvious for me.
Thank you again, hoping the best for you.
Best Regards

Ответить
@RaveKev
@RaveKev - 19.01.2022 08:49

Danke!

Ответить
@6alonl
@6alonl - 27.11.2021 21:53

I don’t think lch renders properly in safari at this moment. 0% lightness should give a black color but it’s not the case. Maybe this is how it’s supposed to be?

Ответить
@kaanergunlu7836
@kaanergunlu7836 - 24.11.2021 17:48

Kevin knows how to touch your heart :D. Joking aside, your contents have been helping me a lot along the way, many thanks!

Ответить
@rezarahman1782
@rezarahman1782 - 19.11.2021 18:22

How can we use HSL in sass variable? I mean,

Let, a color is,
$bg-clr:128,35%,56%;
*
*
*
selector{
Background : hsl+($bg-clr);
*
*
*
Isn’t the correct way. Please show me the correct way. I'm learning Sass for a couple of days.

Ответить
@v0xl
@v0xl - 11.10.2021 15:27

i guess I'm a wizard huh

Ответить
@mahdirostami7034
@mahdirostami7034 - 29.09.2021 11:18

I didn't see the saturation and lightness as a percentage value so I didn't put a % sign for saturation and lightness and it wasn't working. I almost thought it's Firefox that doesn't support it.

Ответить
@nomadshiba
@nomadshiba - 06.09.2021 12:02

i think we can all agree, we are using the code editor or devtools to pick color

Ответить
@poojagarg9182
@poojagarg9182 - 17.08.2021 08:14

awesome video!!

Ответить
@tommysmith5479
@tommysmith5479 - 23.06.2021 15:23

HSL and the VS Code colour picker are both great. But I code (for my job) in the real world: that is to say that I get a colour pallette given to me by a designer. In that case hex is just fine. And because we use SASS, we just variablise (if such a word exists) each hex colour with a meaningful variable name. On a side note: I noticed that your website uses CSS variables - so can I assume that you don't use SASS?

Ответить
@ignisAnimus
@ignisAnimus - 15.06.2021 13:23

I am very experienced with CSS and most of the videos you post are like "knew it already, next..." but this time: Nice one. Will switch to HSL. Very good video. Very well explained. Like it!

Ответить
@arkadybron1994
@arkadybron1994 - 12.06.2021 02:11

The word you were groping for is "Luminance"

Ответить
@AbWischBar
@AbWischBar - 05.06.2021 11:34

HSL is definitely the way to go. But once more I would not have discovered it in CSS without your videos. We just always converted from HSL to RGB. That is just so wonderful with your channel 😀

There was an interesting article (need to find it again) explaining how colors in shadow have a strong saturation and low lightness, whereas colors in bright light have a low saturation and strong lightness. I found that using this principle makes for a very natural color scheme.

But, hehe, for the years now, my team uses a self made luminosity calculator to align the colors in our palettes. So we play with HSL but compare the colors through that tool or let it adjust them.
Will be cool once this is standard in browsers.

Ответить
@manytrickpony695
@manytrickpony695 - 05.06.2021 03:32

180 difference on the hue gives you the complimentary hue.

Ответить
@alexisfy
@alexisfy - 04.06.2021 17:30

As a designer trying to learn to code. Yes, some good practices for good color usage in different devices suggest hsl and a a designer I suggest this for you too. It's easier to understand. There's a conference by the Lyft team that talks about colors consistency through devices

Ответить
@MM-vr8rj
@MM-vr8rj - 28.05.2021 19:07

I mostly still use hex because it's nice and short. I don't really need to remember them because I use a vscode color palette extension in which I can save my color palette so I don't necessarily need to remember the exact values.

Ответить
@duck8dodgers
@duck8dodgers - 05.05.2021 03:29

Am I the only one who prefers Hex because it's actually telling you what the hardware is doing? I know RGB does this too, I just don't find it as intuitive, why force a decimal system onto values that are clearly hexadecimal? (I may be biased here, through my conlang geekery I was use to using non-decimal numerical systems long before I did coding of any type.) The HSL system is to far removed from what you are actually telling your computer screen to do. The Hue value in it to be a rather odd and arbitrary. Why split it in the middle of red? Why not go with violet at 360 so were are at least going from the longest to the shortest wavelengths of visible light?

Ответить
@joincoder
@joincoder - 27.04.2021 09:51

Thank you so much for to explain this

Ответить
@_tanzil_
@_tanzil_ - 23.04.2021 20:53

HSL seems like a little bit easier to guess the colors than RGB. Pretty nice. Thanks

Ответить
@franki01mail
@franki01mail - 21.04.2021 16:58

I don't agree with using hsl on daily basis. In isolated coding environment it may work. But in the most cases, you work with 3rd parties - applications and people. Copy an RGB colour from/to Photoshop or copy an HSL colour - it's much easier to work with RBG colours in Photoshop. Send an HSL to a marketing agency that don't understand how HSL works and how to use it in Canva to create simple assets. With SASS/SCSS I don't even need to modify colours myself, I have saturate(), lighten(), darken() and they do everything for me. Or I can simply copy an RGB colour from other application, and I would say they all support RGB, unlike HSL (just a part). Plus I don't need to know what colour it is, because IDE tells me that.

Ответить
@integrateur
@integrateur - 20.04.2021 16:11

Thanks KP for this!

Ответить
@Victor_Marius
@Victor_Marius - 20.04.2021 15:31

Maybe a button or just an icon of an left-right arrows (<>) to suggest that you can switch between color formats would be nice

Ответить
@jennifermagpantay7933
@jennifermagpantay7933 - 20.04.2021 10:27

I loved your t-shirt <3! Great video, btw!

Ответить
@nickpauletto2127
@nickpauletto2127 - 20.04.2021 02:02

Hi Kevin, there is one thing that I was hoping you were going to touch on which I came across about 2 weeks ago. I see HSL as a circle of colors which (for me being bad with design and colors, I could not be an interior designer) could be used to your advantage when finding colors that go together. For example, complementary colors are opposite each other so, 180 degrees away from each other. The other is the triad color pairing, which would be about 120 degrees on each side of the color you are on ...then the square scheme is 90 degrees from each other. Just thought I would mention this because I really thought you were going to bring this up. For a non-color coordinated person like me, I find this very useful.

Ответить