You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: curriculum/challenges/english/25-front-end-development/review-css-colors/671a90c1cf517678b130419e.md
+79Lines changed: 79 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,86 @@ dashedName: review-css-colors
9
9
10
10
Review the concepts below to prepare for the upcoming quiz.
11
11
12
+
## Color Theory
12
13
14
+
-**Color Theory Definition**: This is the study of how colors interact with each other and how they affect our perception. It covers color relationships, color harmony, and the psychological impact of color.
15
+
-**Primary Colors**: These colors which are yellow, blue, and red, are the fundamental hues from which all other colors are derived.
16
+
-**Secondary Colors**: These colors result from mixing equal amounts of two primary colors. Green, orange, and purple are examples of secondary colors.
17
+
-**Tertiary Colors**: These colors result from combining a primary color with a neighboring secondary color. Yellow-Green, Blue-Green, and Blue-Violet, are examples of tertiary colors.
18
+
-**Warm Colors**: These colors which include reds, oranges, and yellows, evoke feelings of comfort, warmth, and coziness.
19
+
-**Cool Colors**: These colors which include blues, green, and purples, evoke feelings of calmness, serenity, and professionalism.
20
+
-**Color Wheel**: The color wheel is a circular diagram that shows how colors relate to each other. It's an essential tool for designers because it helps them to select color combinations.
21
+
-**Analogous Color Schemes**: These color schemes create cohesive and soothing experiences. They have analogous colors, which are adjacent to each other in the color wheel.
22
+
-**Complementary Color Schemes**: These color schemes create high contrast and visual impact. Their colors are located on the opposite ends of the color wheel, relative to each other.
23
+
-**Triadic Color Scheme**: This color scheme has vibrant colors. They are made from colors that are approximately equidistant from each other. If they are connected, they form an equilateral triangle on the color wheel, like you can see in this example.
24
+
-**Monochromatic Color Scheme**: For this color scheme, all the colors are derived from the same base color by adjusting its lightness, darkness, and saturation. This evokes a feeling of unity and harmony while still creating contrast.
25
+
26
+
## Different Ways to Work with Colors in CSS
27
+
28
+
-**Named Colors**: These colors are predefined color names recognized by browsers. Examples include `blue`, `darkred`, `lightgreen`.
29
+
-**`rgb()` Function**: RGB stands for Red, Green, and Blue — the primary colors of light. These three colors are combined in different intensities to create a wide range of colors. the `rgb()` function allows you to define colors using the RGB color model.
30
+
31
+
```css
32
+
p {
33
+
color: rgb(255, 0, 0);
34
+
}
35
+
```
36
+
37
+
-**`rgba()` Function**: This function adds a fourth value —alpha— that controls the transparency of the color.
38
+
39
+
```css
40
+
div {
41
+
background-color: rgba(0, 0, 255, 0.5);
42
+
}
43
+
```
44
+
45
+
-**`hsl()` Function**: HSL stands for Hue, Saturation, and Lightness — three key components that define a color.
46
+
47
+
```css
48
+
p {
49
+
color: hsl(120, 100%, 50%);
50
+
}
51
+
```
52
+
53
+
-**`hsla()` Function**: This function adds a fourth value -alpha- that controls the opacity of the color.
54
+
55
+
```css
56
+
div {
57
+
background-color: hsla(0, 100%, 50%, 0.5);
58
+
}
59
+
```
60
+
61
+
-**Hexadecimal**: A hex code (short for hexadecimal code) is a six-character string used to represent colors in the RGB color model. The "hex" refers to the base-16 numbering system, which uses digits 0 to 9 and letters A to F.
62
+
63
+
```css
64
+
h1 {
65
+
color: #FF5733; /* A reddish-orange color */
66
+
}
67
+
68
+
p {
69
+
background-color: #4CAF50; /* A shade of green */
70
+
}
71
+
```
72
+
73
+
## Linear and Radial Gradients
74
+
75
+
-**Linear Gradients**: These gradients create a gradual blend between colors along a straight line. You can control the direction of this line and the colors used.
76
+
77
+
```css
78
+
.linear-gradient {
79
+
background: linear-gradient(toright, red, blue);
80
+
height: 40vh;
81
+
}
82
+
```
83
+
84
+
-**Radial Gradients**: These gradients create circular or elliptical gradients that radiate from a central point.
0 commit comments