Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update color-definition.md #551

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion content/functions/color-definition.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ Output: `#5a8120`

### rgba

> Creates a transparent color object from decimal red, green, blue and alpha (RGBA) values.
#### Color Channels as Arguments

> Creates a transparent color object from red, green, blue and alpha (RGBA) values.

Parameters:

Expand All @@ -33,6 +35,32 @@ Example: `rgba(90, 129, 32, 0.5)`

Output: `rgba(90, 129, 32, 0.5)`

#### Transparent Color as Argument

> Converts a transparent color object in RGBA hexadecimal notation (`#RRGGBBAA`) to RGBA notation (`rgba()`).

This is useful for older browsers that [cannot understand RGBA hexadecimal notation](https://caniuse.com/mdn-css_types_color_alpha_hexadecimal_notation), such as Internet Explorer.

Parameters: `color`: color object

Example: `rgba(#00000029)`

Output: `rgba(0, 0, 0, 0.16078431)`

#### Opaque Color as Argument

> Converts an opaque color object in other notations (e.g. `hsl()`, `green`) to RGB hexadecimal notation (`#RRGGBB`).

Parameters: `color`: color object

Example: `rgba(hsl(90, 100%, 50%))`

Output: `#80ff00`

Example: `rgba(red)`

Output: `#ff0000`


### argb

Expand Down