'How do I add code colors to xcode TextEditor()

I'm looking for a way to add code colors, like an IDE. I plan on using a language called lua in the editor. Here's the code I currently have:

import SwiftUI

struct ContentView: View {
    @Binding var document: SysxDocument

    var body: some View {
        TextEditor(text: $document.text)
            .font(.custom("Andale Mono", size: 13))
            
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView(document: .constant(SysxDocument()))
    }
}



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source