> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# color

APISummary
## Introduction

The `color` CSS property sets the foreground [`color value`](/next/api/css/data-type/color.md) of an element's text

## Examples

**This is an example below: css-api**

**Entry:** `src/color`
**Bundle:** `dist/color.lynx.bundle`

```tsx
import { root } from "@lynx-js/react";
import "./index.scss";

const Color = () => {
  const scrollViewStyle = {
    height: "100%",
  };

  const fixedAreaStyle = {
    width: "100%",
    height: "100%",
    flexDirection: "column" as const,
  };

  return (
    <scroll-view className="root" scroll-orientation="vertical" style={scrollViewStyle}>
      <view className="fixed_area" style={fixedAreaStyle}>
        <text className="container text2 font_style">Hello World</text>
        <text className="container text3 font_style">Hello World</text>
        <text className="container text4 font_style">Hello World</text>
        <text className="container text5 font_style">Hello World</text>
        <text className="container text6 font_style">Hello World</text>
        <text className="container text7 font_style">Hello World</text>
        <text className="container text8 font_style">Hello World</text>
        <text className="container text9 font_style">Hello 😄 😄 World</text>
      </view>
    </scroll-view>
  );
};

root.render(<Color />);

```

v0.11.0



## Syntax

```css
/* <named-color> values */
color: red;
color: orange;
color: tan;

/* <hex-color> values */
color: #090;
color: #009900;
color: #090a;
color: #009900aa;

/* <rgb()> values */
color: rgb(34, 12, 64, 0.6);
color: rgba(34, 12, 64, 0.6);
color: rgb(34 12 64 / 0.6);
color: rgba(34 12 64 / 0.3);
color: rgb(34 12 64 / 60%);
color: rgba(34.6 12 64 / 30%);

/* <hsl()> values */
color: hsl(30, 100%, 50%, 0.6);
color: hsla(30, 100%, 50%, 0.6);
color: hsl(30 100% 50% / 0.6);
color: hsla(30 100% 50% / 0.6);
color: hsl(30 100% 50% / 60%);
color: hsla(30.2 100% 50% / 60%);
```

### Values

- [`<color>`](/next/api/css/data-type/color.md)

- [`<gradient>`](/next/api/css/data-type/gradient.md)

## Formal definition

| Initial value | transparent |
| Applies to | text |
| Inherited | no |
| Animatable | yes |


## Formal syntax

```
<color> | <gradient>
```

## Notes

Gradient colors only apply to `text` elements.

## Compatibility

**Compatibility Table**

**Query:** `css.properties.color`

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/22-color.json) · [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/color)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| color | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |

**`color`**

**Specifications:**

