2018-08-24 18:42:07 +02:00
|
|
|
/**
|
|
|
|
* Splash
|
|
|
|
* Copyright (c) John Sundell 2018
|
|
|
|
* MIT license - see LICENSE.md
|
|
|
|
*/
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
2018-08-26 00:58:23 +02:00
|
|
|
#if !os(Linux)
|
|
|
|
|
2018-08-24 18:42:07 +02:00
|
|
|
/// A theme describes what fonts and colors to use when rendering
|
2018-08-26 00:58:23 +02:00
|
|
|
/// certain output formats - such as `NSAttributedString`. Several
|
|
|
|
/// default implementations are provided - see Theme+Defaults.swift.
|
2018-08-24 18:42:07 +02:00
|
|
|
public struct Theme {
|
|
|
|
/// What font to use to render the highlighted text
|
|
|
|
public var font: Font
|
|
|
|
/// What color to use for plain text (no highlighting)
|
|
|
|
public var plainTextColor: Color
|
|
|
|
/// What color to use for the text's highlighted tokens
|
|
|
|
public var tokenColors: [TokenType : Color]
|
|
|
|
|
|
|
|
public init(font: Font, plainTextColor: Color, tokenColors: [TokenType : Color]) {
|
|
|
|
self.font = font
|
|
|
|
self.plainTextColor = plainTextColor
|
|
|
|
self.tokenColors = tokenColors
|
|
|
|
}
|
|
|
|
}
|
2018-08-26 00:58:23 +02:00
|
|
|
|
|
|
|
#endif
|