---
title: "MTColor | Mobile sdk | Mobile sdk ios | Ios"
description: "Color wrapper."
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# MTColor

```
public struct MTColor : Sendable, Codable, Equatable
```

Color wrapper.

-   `[cgColor](#/s:11MapTilerSDK7MTColorV7cgColorSo10CGColorRefaSgvp)`
    
    CGColor representation of the MTColor.
    
    #### Declaration
    
    Swift
    
    ```
    public var cgColor: CGColor? { get }
    ```
    
-   `[init(color:)](#/s:11MapTilerSDK7MTColorV5colorACSo10CGColorRefa_tcfc)`
    
    Initializes the MTColor with CGColor
    
    #### Declaration
    
    Swift
    
    ```
    public init(color: CGColor)
    ```
    
-   `[init(hex:)](#/s:11MapTilerSDK7MTColorV3hexACSS_tcfc)`
    
    Initializes the `MTColor` with a hex string (e.g., “#RRGGBB” or “#RRGGBBAA”).
    
    #### Declaration
    
    Swift
    
    ```
    public init(hex: String)
    ```
