to_hex method

On this page

to_hex

Returns this color in hexadecimal string representation.

def to_hex(self):
    ...

Returns: str: Color hex representation string.

Example

    from GroupDocs.Viewer.Drawing import Rgb24Color

    hex_str = Rgb24Color.KnownColors.CssLevel1.Red.to_hex()
    print(hex_str)  # "#FF0000"
    ```

### See Also
* class [`Rgb24Color`](/viewer/python-net/groupdocs.viewer.drawing/rgb24color/)

On this page