# Parse Color

> Parse a color string (name or hex code) into a hex string.

- ID: `parse_color`
- Type: Block
- Category: [Strings](https://inventor.bot/docs/reference/blocks/strings.md)

> Accepts color names or hex codes. Defaults to black (#000000) if invalid.

- Value block: it can be used directly inside expressions, e.g. `"Result: " + parse_color(Args{...})`.

**Inputs**

| Name | Required | Description | Value |
| --- | --- | --- | --- |
| `color` | yes | Color name or hex code. | e.g. `"#FF0000"` |

**Outputs**

| Name | Description | Value |
| --- | --- | --- |
| `hex_code` | Normalized hex code. | e.g. `"#FF0000"` |

**Example**

```go
parseColor := parse_color(Args{color: "#FF0000"})
send_text_message(Args{channel_id: trigger.channel_id, message_content: "Hex Code: " + parseColor})
```