## Color::ToHex method


Converts the current [Color](../) to its hexadecimal string representation.

```cpp
U16String Aspose::Cells::Color::ToHex(bool withAlpha=false) const
```


| Parameter | Type | Description |
| --- | --- | --- |
| withAlpha | bool | **true** to include the alpha component in the output; otherwise, **false**. |

## ReturnValue

A UTF-16 string that represents the color in hexadecimal format: **#rrggbb** or **#aarrggbb**.
## Remarks



The returned string is always lowercase and prefixed with '#'. 
## See Also

* Class [U16String](../../u16string/)
* Class [Vector](../../vector/)
* Namespace [Aspose::Cells](../../)
* Library [Aspose.Cells for C++](../../../)
