Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ alpha(from var(--my-color) / calc(alpha * 0.5))
- `from <color>`
- : The [relative color](/en-US/docs/Web/CSS/Guides/Colors/Using_relative_colors) syntax keyword `from` followed by any valid {{cssxref("&lt;color&gt;")}} value, defining the **origin color**. The color components of the origin color are carried through to the result unchanged; only the alpha channel is affected.

- `/ <alpha-value>` {{optional_inline}}
- : An {{cssxref("&lt;alpha-value&gt;")}} specifying the alpha of the output color. This can be a `<number>` between `0` and `1`, a `<percentage>` between `0%` and `100%`, or a {{cssxref("calc()")}} expression. Within this value, the keyword **`alpha`** may be used to refer to the alpha channel of the origin color as a `<number>` (where `1.0` is equivalent to `100%`). If this argument is omitted, the alpha of the origin color is used unchanged.
- `/ <alpha-value>`
- : An {{cssxref("&lt;alpha-value&gt;")}} specifying the alpha of the output color. This can be a `<number>` between `0` and `1`, a `<percentage>` between `0%` and `100%`, or a {{cssxref("calc()")}} expression. Within this value, the keyword **`alpha`** may be used to refer to the alpha channel of the origin color as a `<number>` (where `1.0` is equivalent to `100%`).

### Return value

Expand All @@ -42,6 +42,10 @@ Unlike general [relative color syntax](/en-US/docs/Web/CSS/Guides/Colors/Using_r

The return value is always in the same color space as the origin color. For example, if the origin color is an [`oklch()`](/en-US/docs/Web/CSS/Reference/Values/color_value/oklch) color, the result will also be resolved in OKLCh, with the same lightness, chroma, and hue.

## Formal syntax

{{CSSSyntax}}

## Examples

### Replacing the alpha of a color
Expand Down