From df73f6d066ec2dfc040f33474ef308921de11548 Mon Sep 17 00:00:00 2001 From: John Sundell Date: Sun, 26 Aug 2018 00:58:23 +0200 Subject: [PATCH] Disable Color + Theme on Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They don’t really make sense, since there’s no way to use them on Linux, without linking to some form of Linux rendering framework. --- Sources/Splash/Theming/Color.swift | 4 +++- Sources/Splash/Theming/Theme.swift | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Sources/Splash/Theming/Color.swift b/Sources/Splash/Theming/Color.swift index 1fd24f8..a75a46e 100644 --- a/Sources/Splash/Theming/Color.swift +++ b/Sources/Splash/Theming/Color.swift @@ -6,6 +6,8 @@ import Foundation +#if !os(Linux) + /// A representation of a color, for use with a `Theme`. /// Since Splash aims to be cross-platform, it uses this /// simplified color representation rather than `NSColor` @@ -24,7 +26,6 @@ public struct Color { } } -#if !os(Linux) internal extension Color { var renderable: Renderable { return Renderable( @@ -35,6 +36,7 @@ internal extension Color { ) } } + #endif #if os(iOS) diff --git a/Sources/Splash/Theming/Theme.swift b/Sources/Splash/Theming/Theme.swift index 3b274bd..8ce0a51 100644 --- a/Sources/Splash/Theming/Theme.swift +++ b/Sources/Splash/Theming/Theme.swift @@ -6,10 +6,11 @@ import Foundation +#if !os(Linux) + /// A theme describes what fonts and colors to use when rendering -/// certain output formats - such as `NSAttributedString`. A default -/// implementation is provided that matches the "Sundell's Colors" -/// Xcode theme, by using the `sundellsColors(withFont:)` method. +/// certain output formats - such as `NSAttributedString`. Several +/// default implementations are provided - see Theme+Defaults.swift. public struct Theme { /// What font to use to render the highlighted text public var font: Font @@ -24,3 +25,5 @@ public struct Theme { self.tokenColors = tokenColors } } + +#endif