CSS color pro tips

  Рет қаралды 39,722

Kevin Powell

Kevin Powell

Күн бұрын

Пікірлер: 55
@josvelema2362
@josvelema2362 2 жыл бұрын
hsl is my go-to as well , whenever i'm making a site I pick a color from an image , copy it multiple times as variables and for example turn down the saturation a bit and lightness to get a color for boxshadows , use the degrees in opossite direction to get contrasting/complementing color , etc etc . If you do this a lot it's a bit easier to visualize color wheels/spectrums :)
@KOBE42__
@KOBE42__ 2 жыл бұрын
I do this as well but using hexa colours. Only problem with hexa colours is that I have to use an online tool to find complimentary/split complimentary/ Monotone colours. Will definitely start using HSL from now on and try and get used to the colour wheel.
@ScriptRaccoon
@ScriptRaccoon 2 жыл бұрын
03:03 I think this deserves a different explanation. 255 is not just a random number, it is 256 - 1 with 256 = 2^8 being a power of 2 (which is also 16^2, which explains the correspondence to hexadecimal code), exactly what we can store in 1 byte. Since we want to include 0 but also want to have 2^8 possibles values, the numbers should actually end with 2^8 - 1. This also means that when we want to get the half value, we just use 2^7 = 128, namely (2^8 - 1)/2 = 2^7 - 0.5 = 128 - 0.5 = 127.5. That being said, this was a great video. I simply didn't know that we can use percentages in the rgb function. Very useful!
@peterholzer4481
@peterholzer4481 2 жыл бұрын
To expand a bit on this, 0 to 255 is the range of integers which can be stored in a single byte, so it's kind of natural to choose this range for something stored in a computer. It' not necessary, though. There have been graphics cards with less (e.g 5 bits) or more (10 bits) per RGB channel, and there are graphics formats with 16 bits per channel. They will generally always use a power of two to avoid wasting space.
@peterholzer4481
@peterholzer4481 2 жыл бұрын
It's easier to do math with these numbers if you do mental arithmetic in hex 😀
@avisian8063
@avisian8063 2 жыл бұрын
@@peterholzer4481 "expand a bit" i see what you accidentally did there
@peterholzer4481
@peterholzer4481 2 жыл бұрын
@@avisian8063 That wasn't an accident.
@SerenityForschen
@SerenityForschen 2 жыл бұрын
As the person who manages websites and is the go between developer and designer, I've been so happy to find your videos. My current endeavor is fixing and updating a company site that has quarks like uneven margins, hiding the radio buttons site wide or my favorite thing so far a bottom margin on a specific component is set at 4% which extra boggles my mind. You have given me some great ideas to fix the CSS and make the site functional.
@katrinaaponte4787
@katrinaaponte4787 2 жыл бұрын
Thank you for your awesome tips and tricks Kevin. I think you're the biggest reason that I've come as far as I have when it comes to CSS coding.
@bobbysilver272
@bobbysilver272 2 жыл бұрын
A nice, useful video Kevin. Thanks.
@ianpageproduction
@ianpageproduction 2 жыл бұрын
your super awesome i love CSS ive only been coding for 8 months but Im full stack in python,java,javascript...by far my favorite thing to do is CSS and styling i really want to get a front end UI/UX job and im addicted to your channel. Keep the great content flowing your awesome! the hsl tip is gonna be so helpfull!
@reb569
@reb569 2 жыл бұрын
Awesome video. Thanks for the tip on VS Code and swapping between hex, rgb, hsl. I didn't know about that!
@rmasoni
@rmasoni 2 жыл бұрын
This was actually mind blowing! I always hated the commas on rgb(). Also, percentages everywhere? How did I miss all of this?!
@TheZyruks
@TheZyruks 2 жыл бұрын
Weird i was making a color design system with sass and you drop this video. Perfect Timing.
@onetoptv1404
@onetoptv1404 2 жыл бұрын
So informative, thanks a lot!
@Gallowtown
@Gallowtown 2 жыл бұрын
Thanks so much, i register to the responsive layout course hope i begin with it in the next weekend.
@BossPetta
@BossPetta 2 жыл бұрын
I don't know how much time I have lost converting between colour units. Only for that… thanks Kevin ♥️
@ComeCaramelos_
@ComeCaramelos_ 2 жыл бұрын
Useful tricks! Using hex values allows you to manage the opacity by adding from 00 to FF at the end (#f25f3a99)
@xzchc
@xzchc 2 жыл бұрын
hsl(5000 100% 50%) -- finally we can see beyond ultra violett! ;D
@vertigoz
@vertigoz 8 ай бұрын
4:20 Hsl might as well drop the % altogether
@salmanfarshisajib6512
@salmanfarshisajib6512 2 жыл бұрын
Always love your videos.👍
@dariussturge9686
@dariussturge9686 2 жыл бұрын
The CSS King/Jedi
@JohnBortins
@JohnBortins 2 жыл бұрын
Outstanding!
@Stoney_Eagle
@Stoney_Eagle 2 жыл бұрын
Css color just got harder... Not color itself but chrome decided to add a new property called chrome-autofill when you autofill, which has a higher specificity than any class class set on them and has !important on the color and bg color. 🤬 So I had to resort to drastic measures with: input id starts with. But thanks to you I know how to deal with specificity 😉
@tombyrer1808
@tombyrer1808 2 жыл бұрын
Have a link please? "Autofill" is the worst term to Google....
@Stoney_Eagle
@Stoney_Eagle 2 жыл бұрын
​@@tombyrer1808 Kevin has a video on css specificity where he explains how CSS rules take priority over others. but for now you can add this to your CSS: input[id^="yourIdPrefix-"] { background-color: blue !important; color: red !important; } And give all your input fields an id that starts with "yourIdPrefix-" StackOverflow and google are my 2 best friends 😉
@lofiandchill6062
@lofiandchill6062 Жыл бұрын
The color switching mode trick does not work on my vscode for some reason. It only switches to hex and rgb. And when I manually type in hsl, the color picker disappears! its like vscode cannot recognise it.
@alexzweers
@alexzweers 2 жыл бұрын
thanks very useful, you are a legend 😀!
@laweffect
@laweffect 2 жыл бұрын
Are hex values not recommended?
@RaviSharma-rz4eh
@RaviSharma-rz4eh 2 жыл бұрын
great content
@justkailash
@justkailash Жыл бұрын
If i want to create neutral colour shades (or any other colour shades) .. which is better method .. using separate colour code for each shade or use base colour code and add alpha value?
@vinaypatil8009
@vinaypatil8009 2 жыл бұрын
Sir please make CSS full pledged modern course/series from beginner friendly to advanced and with awesome project
@MrMairu555
@MrMairu555 2 жыл бұрын
I'm sort-of stuck on RGB still, as the colours I use for my main website I've been using for over 20 years now! It's just so easy to bang in the RGB values, but Photoshop and Illustrator still predominantly use RGB too (unless it's for print), so switching to HSL is a bit of a PITA for me. HSL does seem a lot easier during raw coding when I see you use it in your videos though.
@nagualdesign
@nagualdesign 2 жыл бұрын
The Photoshop color picker shows RGB (hex), red, green and blue, hue, saturation and lightness, _and_ L, a and b, all in one panel.
@arunsaklani9890
@arunsaklani9890 2 жыл бұрын
Can u plz tell me which units good for width height ?
@AlvinIsChipmunk
@AlvinIsChipmunk 2 жыл бұрын
quite helpful even for a newbie like me...
@brandonsayring
@brandonsayring 2 жыл бұрын
I have been doing a lot of work in GLSL lately and I really wish the css rgba values were compatible with fragment shader 0 to 1 float values.
@KevinPowell
@KevinPowell 2 жыл бұрын
If it's RGB, I looked at how you can use 0% - 100% values instead of 0 - 255 in the video. Using percentages should be equivalent but with some extra 0s at the end. Not exactly the same, but at least you don't have to change your mental model to get it to work.
@brandonsayring
@brandonsayring 2 жыл бұрын
@@KevinPowell yes, a fragment shader's color output is a 4 dimensional vector where each vector represents an RGBA channel. You're right, the conversion from a percentage into a 0-1 float is a lot easier to mentally process than a 0-255 int, though the conversion is the same (divide the value of a channel by its maximum potential value). I just think it would be a bit nicer if it was less hacky when using Dom element color values as shader uniform input data for example.
@mauricebuchi
@mauricebuchi 2 жыл бұрын
Nice but i still like the 'a' for clarity sake
@DavidMermelstein
@DavidMermelstein 2 жыл бұрын
That VScode color switcher is being hidden is ridiculous. I found it a couple of yrs ago because I was going to install a plugin for it.
@skillzorskillsson8228
@skillzorskillsson8228 2 жыл бұрын
when writing hsl colors you dont even need %. You can just write hsl(130 100 50) and it works :)
@anandca4096
@anandca4096 2 жыл бұрын
I very much like css tips videos provided my you
@tienkhaihuynh1287
@tienkhaihuynh1287 2 жыл бұрын
"Be Vietnam Pro" 😆
@mhasancoder
@mhasancoder 2 жыл бұрын
color: rgb(50% 100% 255); this is not worked in my chrome browser body{ font-size: 3rem } .red{ color: rgb(100% 0% 0%); } .green{ color: rgb(0, 255, 0, .5); } .blue{ color: rgb(50% 100% 255); } Red Green Blue
@arunsp767
@arunsp767 2 жыл бұрын
I've always used percentage as my stupid @$$ brain doesn't like starting with a dot. I have to anyways start with a zero. Thus turns out writing percentage is easier 😄
@suelingsusu1339
@suelingsusu1339 2 жыл бұрын
🙏🙏🙏🖖🖖🖖🖖🖖
@Skillthrive
@Skillthrive 2 жыл бұрын
First!
@alexg4927
@alexg4927 2 жыл бұрын
Fifteenth!
@Skillthrive
@Skillthrive 2 жыл бұрын
@@alexg4927 LETS GO!
@DeveshKumar-hs4qo
@DeveshKumar-hs4qo 2 жыл бұрын
How to make everything complicated.
@krccmsitp2884
@krccmsitp2884 2 жыл бұрын
With great flexibility comes great responsibility. 😉
@photomat
@photomat 2 жыл бұрын
"This is in Chrome right now" --> worst browser for doing colour demos as Chrome is not representing colours properly ....
@cdey3886
@cdey3886 2 жыл бұрын
third :D
My top 5 most popular front-end tips
22:07
Kevin Powell
Рет қаралды 69 М.
Learn flexbox the easy way
34:04
Kevin Powell
Рет қаралды 732 М.
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
How a Code Update Almost Cost Airbnb $2,000,000,000
12:38
Re: Design
Рет қаралды 3,4 М.
Container Queries are going to change how we make layouts
24:24
Kevin Powell
Рет қаралды 177 М.
CSS Tips And Tricks I Wish I Knew Before
12:12
Lama Dev
Рет қаралды 496 М.
Are You Making This Mistake With CSS Colors?
6:58
Web Dev Simplified
Рет қаралды 164 М.
The Dome Paradox: A Loophole in Newton's Laws
22:59
Up and Atom
Рет қаралды 707 М.
What is mathematical thinking actually like?
9:44
Benjamin Keep, PhD, JD
Рет қаралды 8 М.
Can I clone this rotating, gradient, inner glow effect?
23:05
Kevin Powell
Рет қаралды 52 М.
Learn CSS Subgrid in 14 minutes
14:19
Slaying The Dragon
Рет қаралды 91 М.
CSS Popover + Anchor Positioning is Magical
20:44
Kevin Powell
Рет қаралды 50 М.
Learn CSS Grid the easy way
37:04
Kevin Powell
Рет қаралды 942 М.
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН