Mitchell Hashimoto 99db6b59be Add config color palette C bindings (#7195)
C bindings to expose the color palette to Swift for macOS. Returns the
full 256 colors from the current color scheme. After fetching the
palette with `ghostty_config_get`, you can access the desired color by
its index in the list.

### Usage

Here is one way to get the palette in Swift.

```swift
import GhosttyKit

private(set) var config: ghostty_config_t? = nil {
    didSet {
        // Free the old value whenever we change
        guard let old = oldValue else { return }
        ghostty_config_free(old)
    }
}

var paletteColors: [Color] {
    var paletteList: ghostty_config_palette_s = .init()
    let key = "palette"
    
    if (!ghostty_config_get(config, &paletteList, key, UInt(key.count))) {
        return []
    }
    
    var colors: [Color] = []
    let mirror = Mirror(reflecting: paletteList.colors)
    
    for (_, element) in mirror.children {
        if let color = element as? ghostty_config_color_s {
            colors.append(Color(
                red: Double(color.r) / 255,
                green: Double(color.g) / 255,
                blue: Double(color.b) / 255
            ))
        }
    }
    
    print("Palette Colors: ", colors)
    return colors
}
```
Result (GruvboxDarkHard theme)
![CleanShot 2025-04-25 at 14 21
39](https://github.com/user-attachments/assets/a282fd8d-3e5e-4281-819c-dff00b84318f)
2025-04-27 07:14:26 -07:00
..
2024-03-26 16:14:25 -07:00
2025-04-23 08:10:01 -05:00
2025-03-12 09:55:52 -07:00
2025-03-12 10:04:17 -07:00
2025-04-26 23:51:04 -05:00
2025-04-22 08:33:32 -07:00
2025-03-12 10:15:14 -07:00
2025-01-18 22:47:18 +09:00
2025-03-12 10:04:17 -07:00
2025-04-14 11:19:19 -07:00
2025-03-12 09:55:52 -07:00
2025-02-11 16:43:50 -08:00
2024-09-26 22:00:11 -07:00
2025-03-11 14:39:04 -07:00
2024-10-18 08:11:11 -07:00
2025-03-12 09:55:52 -07:00
2025-03-11 14:53:30 -07:00
2025-03-07 13:42:00 -08:00
2024-08-16 14:35:10 -07:00
2022-08-18 11:42:32 -07:00
2025-03-12 16:29:17 -07:00
2025-03-12 11:29:13 -07:00
2025-03-12 09:55:52 -07:00
2025-04-21 10:05:30 -07:00
2024-08-16 10:36:10 -07:00