Marshal turns the text component to a classic color code message
(component TextComponent, codeChar rune)
| 109 | |
| 110 | // Marshal turns the text component to a classic color code message |
| 111 | func Marshal(component TextComponent, codeChar rune) string { |
| 112 | var components = append([]TextComponent{component}, component.Extra...) |
| 113 | |
| 114 | var text string |
| 115 | for _, comp := range components { |
| 116 | componentStyles(comp, &text, codeChar) |
| 117 | text += comp.Text |
| 118 | } |
| 119 | |
| 120 | return text |
| 121 | } |
| 122 | |
| 123 | func charColor(char rune) string { |
| 124 | switch char { |
nothing calls this directly
no test coverage detected