Skip to content

Commit 4292d95

Browse files
authored
feat(curriculum): adding content to css colors review page (freeCodeCamp#57048)
1 parent 228484d commit 4292d95

File tree

2 files changed

+81
-1
lines changed

2 files changed

+81
-1
lines changed

client/i18n/locales/english/intro.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1993,7 +1993,8 @@
19931993
"review-css-colors": {
19941994
"title": "CSS Colors Review",
19951995
"intro": [
1996-
"Review the CSS Colors concepts to prepare for the upcoming quiz."
1996+
"Before you are quizzed on CSS colors, you first need to review.",
1997+
"Open up this page to review concepts like the <code>rgb()</code> function, <code>hsl()</code> function, <code>hex codes</code>, and more."
19971998
]
19981999
},
19992000
"quiz-css-colors": {

curriculum/challenges/english/25-front-end-development/review-css-colors/671a90c1cf517678b130419e.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,86 @@ dashedName: review-css-colors
99

1010
Review the concepts below to prepare for the upcoming quiz.
1111

12+
## Color Theory
1213

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(to right, red, blue);
80+
height: 40vh;
81+
}
82+
```
83+
84+
- **Radial Gradients**: These gradients create circular or elliptical gradients that radiate from a central point.
85+
86+
```css
87+
.radial-gradient {
88+
background: radial-gradient(circle, red, blue);
89+
height: 40vh;
90+
}
91+
```
1392

1493
# --assignment--
1594

0 commit comments

Comments
 (0)