Skip to content

Commit

Permalink
Reword css-colors\applying color and rgb/hsl
Browse files Browse the repository at this point in the history
Like before it now mention and gives of examples of both percentage and number values, although mentions percentage first.

Similarly, I've made rgb and hsl use both to show them being used.
  • Loading branch information
FormularSumo committed Jan 2, 2024
1 parent 1193b18 commit fae86b3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions files/en-us/web/css/color_value/hsl/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ div.space-separated {
}

div.comma-separated {
background-color: hsl(0, 100%, 50%, 50%);
background-color: hsl(0, 100%, 50%, 0.5);
}
```

Expand Down Expand Up @@ -138,7 +138,7 @@ div.hsl {
}

div.hsla {
background-color: hsla(0, 100%, 50%, 50%);
background-color: hsla(0, 100%, 50%, 0.5);
}
```

Expand Down
6 changes: 3 additions & 3 deletions files/en-us/web/css/color_value/rgb/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The **`rgb()`** functional notation expresses a color according to its red, gree

```css
rgb(255 255 255)
rgb(255 255 255 / .5)
rgb(255 255 255 / 50%)
```

The function also accepts a legacy syntax in which all values are separated with commas.
Expand Down Expand Up @@ -62,7 +62,7 @@ div {
}

div.space-separated {
background-color: rgb(255 0 0 / 0.5);
background-color: rgb(255 0 0 / 50%);
}

div.comma-separated {
Expand Down Expand Up @@ -95,7 +95,7 @@ div {
}

div.rgb {
background-color: rgb(255 0 0 / 0.5);
background-color: rgb(255 0 0 / 50%);
}

div.rgba {
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/css/css_colors/applying_color/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ Legal values for each of these parameters are:
- `red`, `green`, and `blue`
- : Each must be an {{cssxref("<integer>")}} value between 0 and 255 (inclusive), or a {{cssxref("<percentage>")}} from 0% to 100%.
- `alpha`
- : The alpha channel is percentage where 0% (fully transparent) and 100% (fully opaque).
- : The alpha channel is percentage between 0% (fully transparent) and 100% (fully opaque), or a number between 0.0 (same as 0%) and 1.0 (same as 100%).

For example, a bright red that's 50% opaque can be represented as `rgb(255 0 0 50%)` or `rgb(100% 0 0 50%)`.
For example, a bright red that's 50% opaque can be represented as `rgb(255 0 0 / 50%)` or `rgb(100% 0 0 / 0.5)`.

### Color functions with a hue component

Expand Down

0 comments on commit fae86b3

Please sign in to comment.