├── ColoredConsole-Bold.colored.ttx ├── ColoredConsole-Bold.ttf ├── ColoredConsole-Bold.ttx ├── ColoredConsole.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── ColoredConsole ├── String+Colors.swift └── main.swift ├── Images.sketch ├── LICENSE.txt ├── README.md ├── color-range.png ├── colorify.pl ├── xcode-console.png └── xcode-preferences.png /ColoredConsole-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjrscott/ColoredConsole/da8f1032b0678e1e90ad44e3589f7529d1dd7f83/ColoredConsole-Bold.ttf -------------------------------------------------------------------------------- /ColoredConsole.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 060101AE23083B6400955566 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 060101AD23083B6400955566 /* main.swift */; }; 11 | 060101B523085E6300955566 /* String+Colors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 060101B423085E6300955566 /* String+Colors.swift */; }; 12 | /* End PBXBuildFile section */ 13 | 14 | /* Begin PBXCopyFilesBuildPhase section */ 15 | 060101A823083B6400955566 /* CopyFiles */ = { 16 | isa = PBXCopyFilesBuildPhase; 17 | buildActionMask = 2147483647; 18 | dstPath = /usr/share/man/man1/; 19 | dstSubfolderSpec = 0; 20 | files = ( 21 | ); 22 | runOnlyForDeploymentPostprocessing = 1; 23 | }; 24 | /* End PBXCopyFilesBuildPhase section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 060101AA23083B6400955566 /* ColoredConsole */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ColoredConsole; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | 060101AD23083B6400955566 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 29 | 060101B423085E6300955566 /* String+Colors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Colors.swift"; sourceTree = ""; }; 30 | /* End PBXFileReference section */ 31 | 32 | /* Begin PBXFrameworksBuildPhase section */ 33 | 060101A723083B6400955566 /* Frameworks */ = { 34 | isa = PBXFrameworksBuildPhase; 35 | buildActionMask = 2147483647; 36 | files = ( 37 | ); 38 | runOnlyForDeploymentPostprocessing = 0; 39 | }; 40 | /* End PBXFrameworksBuildPhase section */ 41 | 42 | /* Begin PBXGroup section */ 43 | 060101A123083B6400955566 = { 44 | isa = PBXGroup; 45 | children = ( 46 | 060101AC23083B6400955566 /* ColoredConsole */, 47 | 060101AB23083B6400955566 /* Products */, 48 | ); 49 | sourceTree = ""; 50 | }; 51 | 060101AB23083B6400955566 /* Products */ = { 52 | isa = PBXGroup; 53 | children = ( 54 | 060101AA23083B6400955566 /* ColoredConsole */, 55 | ); 56 | name = Products; 57 | sourceTree = ""; 58 | }; 59 | 060101AC23083B6400955566 /* ColoredConsole */ = { 60 | isa = PBXGroup; 61 | children = ( 62 | 060101AD23083B6400955566 /* main.swift */, 63 | 060101B423085E6300955566 /* String+Colors.swift */, 64 | ); 65 | path = ColoredConsole; 66 | sourceTree = ""; 67 | }; 68 | /* End PBXGroup section */ 69 | 70 | /* Begin PBXNativeTarget section */ 71 | 060101A923083B6400955566 /* ColoredConsole */ = { 72 | isa = PBXNativeTarget; 73 | buildConfigurationList = 060101B123083B6400955566 /* Build configuration list for PBXNativeTarget "ColoredConsole" */; 74 | buildPhases = ( 75 | 060101A623083B6400955566 /* Sources */, 76 | 060101A723083B6400955566 /* Frameworks */, 77 | 060101A823083B6400955566 /* CopyFiles */, 78 | ); 79 | buildRules = ( 80 | ); 81 | dependencies = ( 82 | ); 83 | name = ColoredConsole; 84 | productName = ColoredConsole; 85 | productReference = 060101AA23083B6400955566 /* ColoredConsole */; 86 | productType = "com.apple.product-type.tool"; 87 | }; 88 | /* End PBXNativeTarget section */ 89 | 90 | /* Begin PBXProject section */ 91 | 060101A223083B6400955566 /* Project object */ = { 92 | isa = PBXProject; 93 | attributes = { 94 | LastSwiftUpdateCheck = 1020; 95 | LastUpgradeCheck = 1020; 96 | ORGANIZATIONNAME = "John Scott"; 97 | TargetAttributes = { 98 | 060101A923083B6400955566 = { 99 | CreatedOnToolsVersion = 10.2.1; 100 | }; 101 | }; 102 | }; 103 | buildConfigurationList = 060101A523083B6400955566 /* Build configuration list for PBXProject "ColoredConsole" */; 104 | compatibilityVersion = "Xcode 9.3"; 105 | developmentRegion = en; 106 | hasScannedForEncodings = 0; 107 | knownRegions = ( 108 | en, 109 | ); 110 | mainGroup = 060101A123083B6400955566; 111 | productRefGroup = 060101AB23083B6400955566 /* Products */; 112 | projectDirPath = ""; 113 | projectRoot = ""; 114 | targets = ( 115 | 060101A923083B6400955566 /* ColoredConsole */, 116 | ); 117 | }; 118 | /* End PBXProject section */ 119 | 120 | /* Begin PBXSourcesBuildPhase section */ 121 | 060101A623083B6400955566 /* Sources */ = { 122 | isa = PBXSourcesBuildPhase; 123 | buildActionMask = 2147483647; 124 | files = ( 125 | 060101B523085E6300955566 /* String+Colors.swift in Sources */, 126 | 060101AE23083B6400955566 /* main.swift in Sources */, 127 | ); 128 | runOnlyForDeploymentPostprocessing = 0; 129 | }; 130 | /* End PBXSourcesBuildPhase section */ 131 | 132 | /* Begin XCBuildConfiguration section */ 133 | 060101AF23083B6400955566 /* Debug */ = { 134 | isa = XCBuildConfiguration; 135 | buildSettings = { 136 | ALWAYS_SEARCH_USER_PATHS = NO; 137 | CLANG_ANALYZER_NONNULL = YES; 138 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 139 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 140 | CLANG_CXX_LIBRARY = "libc++"; 141 | CLANG_ENABLE_MODULES = YES; 142 | CLANG_ENABLE_OBJC_ARC = YES; 143 | CLANG_ENABLE_OBJC_WEAK = YES; 144 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 145 | CLANG_WARN_BOOL_CONVERSION = YES; 146 | CLANG_WARN_COMMA = YES; 147 | CLANG_WARN_CONSTANT_CONVERSION = YES; 148 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 149 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 150 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 151 | CLANG_WARN_EMPTY_BODY = YES; 152 | CLANG_WARN_ENUM_CONVERSION = YES; 153 | CLANG_WARN_INFINITE_RECURSION = YES; 154 | CLANG_WARN_INT_CONVERSION = YES; 155 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 156 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 157 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 158 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 159 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 160 | CLANG_WARN_STRICT_PROTOTYPES = YES; 161 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 162 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 163 | CLANG_WARN_UNREACHABLE_CODE = YES; 164 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 165 | CODE_SIGN_IDENTITY = "-"; 166 | COPY_PHASE_STRIP = NO; 167 | DEBUG_INFORMATION_FORMAT = dwarf; 168 | ENABLE_STRICT_OBJC_MSGSEND = YES; 169 | ENABLE_TESTABILITY = YES; 170 | GCC_C_LANGUAGE_STANDARD = gnu11; 171 | GCC_DYNAMIC_NO_PIC = NO; 172 | GCC_NO_COMMON_BLOCKS = YES; 173 | GCC_OPTIMIZATION_LEVEL = 0; 174 | GCC_PREPROCESSOR_DEFINITIONS = ( 175 | "DEBUG=1", 176 | "$(inherited)", 177 | ); 178 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 179 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 180 | GCC_WARN_UNDECLARED_SELECTOR = YES; 181 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 182 | GCC_WARN_UNUSED_FUNCTION = YES; 183 | GCC_WARN_UNUSED_VARIABLE = YES; 184 | MACOSX_DEPLOYMENT_TARGET = 10.14; 185 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 186 | MTL_FAST_MATH = YES; 187 | ONLY_ACTIVE_ARCH = YES; 188 | SDKROOT = macosx; 189 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 190 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 191 | }; 192 | name = Debug; 193 | }; 194 | 060101B023083B6400955566 /* Release */ = { 195 | isa = XCBuildConfiguration; 196 | buildSettings = { 197 | ALWAYS_SEARCH_USER_PATHS = NO; 198 | CLANG_ANALYZER_NONNULL = YES; 199 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 200 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 201 | CLANG_CXX_LIBRARY = "libc++"; 202 | CLANG_ENABLE_MODULES = YES; 203 | CLANG_ENABLE_OBJC_ARC = YES; 204 | CLANG_ENABLE_OBJC_WEAK = YES; 205 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 206 | CLANG_WARN_BOOL_CONVERSION = YES; 207 | CLANG_WARN_COMMA = YES; 208 | CLANG_WARN_CONSTANT_CONVERSION = YES; 209 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 210 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 211 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 212 | CLANG_WARN_EMPTY_BODY = YES; 213 | CLANG_WARN_ENUM_CONVERSION = YES; 214 | CLANG_WARN_INFINITE_RECURSION = YES; 215 | CLANG_WARN_INT_CONVERSION = YES; 216 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 217 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 218 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 219 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 220 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 221 | CLANG_WARN_STRICT_PROTOTYPES = YES; 222 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 223 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 224 | CLANG_WARN_UNREACHABLE_CODE = YES; 225 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 226 | CODE_SIGN_IDENTITY = "-"; 227 | COPY_PHASE_STRIP = NO; 228 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 229 | ENABLE_NS_ASSERTIONS = NO; 230 | ENABLE_STRICT_OBJC_MSGSEND = YES; 231 | GCC_C_LANGUAGE_STANDARD = gnu11; 232 | GCC_NO_COMMON_BLOCKS = YES; 233 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 234 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 235 | GCC_WARN_UNDECLARED_SELECTOR = YES; 236 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 237 | GCC_WARN_UNUSED_FUNCTION = YES; 238 | GCC_WARN_UNUSED_VARIABLE = YES; 239 | MACOSX_DEPLOYMENT_TARGET = 10.14; 240 | MTL_ENABLE_DEBUG_INFO = NO; 241 | MTL_FAST_MATH = YES; 242 | SDKROOT = macosx; 243 | SWIFT_COMPILATION_MODE = wholemodule; 244 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 245 | }; 246 | name = Release; 247 | }; 248 | 060101B223083B6400955566 /* Debug */ = { 249 | isa = XCBuildConfiguration; 250 | buildSettings = { 251 | CODE_SIGN_STYLE = Automatic; 252 | PRODUCT_NAME = "$(TARGET_NAME)"; 253 | SWIFT_VERSION = 5.0; 254 | }; 255 | name = Debug; 256 | }; 257 | 060101B323083B6400955566 /* Release */ = { 258 | isa = XCBuildConfiguration; 259 | buildSettings = { 260 | CODE_SIGN_STYLE = Automatic; 261 | PRODUCT_NAME = "$(TARGET_NAME)"; 262 | SWIFT_VERSION = 5.0; 263 | }; 264 | name = Release; 265 | }; 266 | /* End XCBuildConfiguration section */ 267 | 268 | /* Begin XCConfigurationList section */ 269 | 060101A523083B6400955566 /* Build configuration list for PBXProject "ColoredConsole" */ = { 270 | isa = XCConfigurationList; 271 | buildConfigurations = ( 272 | 060101AF23083B6400955566 /* Debug */, 273 | 060101B023083B6400955566 /* Release */, 274 | ); 275 | defaultConfigurationIsVisible = 0; 276 | defaultConfigurationName = Release; 277 | }; 278 | 060101B123083B6400955566 /* Build configuration list for PBXNativeTarget "ColoredConsole" */ = { 279 | isa = XCConfigurationList; 280 | buildConfigurations = ( 281 | 060101B223083B6400955566 /* Debug */, 282 | 060101B323083B6400955566 /* Release */, 283 | ); 284 | defaultConfigurationIsVisible = 0; 285 | defaultConfigurationName = Release; 286 | }; 287 | /* End XCConfigurationList section */ 288 | }; 289 | rootObject = 060101A223083B6400955566 /* Project object */; 290 | } 291 | -------------------------------------------------------------------------------- /ColoredConsole.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ColoredConsole.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ColoredConsole/String+Colors.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+Colors.swift 3 | // ColoredConsole 4 | // 5 | // Created by John Scott on 17/08/2019. 6 | // Copyright © 2019 John Scott. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension String { 12 | func failureColor() -> String { 13 | return Array(self).map({ "\($0)\u{fe06}"}).joined() 14 | } 15 | 16 | func successColor() -> String { 17 | return Array(self).map({ "\($0)\u{fe07}"}).joined() 18 | } 19 | 20 | func warningColor() -> String { 21 | return Array(self).map({ "\($0)\u{fe08}"}).joined() 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ColoredConsole/main.swift: -------------------------------------------------------------------------------- 1 | // 2 | // main.swift 3 | // ColoredConsole 4 | // 5 | // Created by John Scott on 17/08/2019. 6 | // Copyright © 2019 John Scott. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | print("They're all dead. Everybody's dead, Dave.".failureColor()) 12 | print("Hello World!".successColor()) 13 | print("Houston we have a problem.".warningColor()) 14 | -------------------------------------------------------------------------------- /Images.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjrscott/ColoredConsole/da8f1032b0678e1e90ad44e3589f7529d1dd7f83/Images.sketch -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Digitized data copyright (c) 2012-2015, The Mozilla Foundation and Telefonica S.A. 2 | 3 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 4 | This license is copied below, and is also available with a FAQ at: 5 | http://scripts.sil.org/OFL 6 | 7 | 8 | ----------------------------------------------------------- 9 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 10 | ----------------------------------------------------------- 11 | 12 | PREAMBLE 13 | The goals of the Open Font License (OFL) are to stimulate worldwide 14 | development of collaborative font projects, to support the font creation 15 | efforts of academic and linguistic communities, and to provide a free and 16 | open framework in which fonts may be shared and improved in partnership 17 | with others. 18 | 19 | The OFL allows the licensed fonts to be used, studied, modified and 20 | redistributed freely as long as they are not sold by themselves. The 21 | fonts, including any derivative works, can be bundled, embedded, 22 | redistributed and/or sold with any software provided that any reserved 23 | names are not used by derivative works. The fonts and derivatives, 24 | however, cannot be released under any other type of license. The 25 | requirement for fonts to remain under this license does not apply 26 | to any document created using the fonts or their derivatives. 27 | 28 | DEFINITIONS 29 | "Font Software" refers to the set of files released by the Copyright 30 | Holder(s) under this license and clearly marked as such. This may 31 | include source files, build scripts and documentation. 32 | 33 | "Reserved Font Name" refers to any names specified as such after the 34 | copyright statement(s). 35 | 36 | "Original Version" refers to the collection of Font Software components as 37 | distributed by the Copyright Holder(s). 38 | 39 | "Modified Version" refers to any derivative made by adding to, deleting, 40 | or substituting -- in part or in whole -- any of the components of the 41 | Original Version, by changing formats or by porting the Font Software to a 42 | new environment. 43 | 44 | "Author" refers to any designer, engineer, programmer, technical 45 | writer or other person who contributed to the Font Software. 46 | 47 | PERMISSION & CONDITIONS 48 | Permission is hereby granted, free of charge, to any person obtaining 49 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 50 | redistribute, and sell modified and unmodified copies of the Font 51 | Software, subject to the following conditions: 52 | 53 | 1) Neither the Font Software nor any of its individual components, 54 | in Original or Modified Versions, may be sold by itself. 55 | 56 | 2) Original or Modified Versions of the Font Software may be bundled, 57 | redistributed and/or sold with any software, provided that each copy 58 | contains the above copyright notice and this license. These can be 59 | included either as stand-alone text files, human-readable headers or 60 | in the appropriate machine-readable metadata fields within text or 61 | binary files as long as those fields can be easily viewed by the user. 62 | 63 | 3) No Modified Version of the Font Software may use the Reserved Font 64 | Name(s) unless explicit written permission is granted by the corresponding 65 | Copyright Holder. This restriction only applies to the primary font name as 66 | presented to the users. 67 | 68 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 69 | Software shall not be used to promote, endorse or advertise any 70 | Modified Version, except to acknowledge the contribution(s) of the 71 | Copyright Holder(s) and the Author(s) or with their explicit written 72 | permission. 73 | 74 | 5) The Font Software, modified or unmodified, in part or in whole, 75 | must be distributed entirely under this license, and must not be 76 | distributed under any other license. The requirement for fonts to 77 | remain under this license does not apply to any document created 78 | using the Font Software. 79 | 80 | TERMINATION 81 | This license becomes null and void if any of the above conditions are 82 | not met. 83 | 84 | DISCLAIMER 85 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 86 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 87 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 88 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 89 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 90 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 91 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 92 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 93 | OTHER DEALINGS IN THE FONT SOFTWARE. 94 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Colored Console 2 | 3 | This project reenables colors in Xcode's console (with a limited palette). Just like this: 4 | 5 |

6 | 7 | ## Installation 8 | 9 | 1. Add the font file named [`ColoredConsole-Bold.ttf`](ColoredConsole-Bold.ttf) in the repo via the Mac OS application [Font Book](https://en.wikipedia.org/wiki/Font_Book). 10 | 2. Back to Xcode. Go to "Preference" "Texts & Colors" "Executable console Output", click the font icon below, then set font to "Colored Console Bold" 11 | 12 |

13 | 14 | 15 | ## How it works 16 | 17 | It's been nearly 3 years since the issue "[Xcode 8 kills code colors](https://github.com/robbiehanson/XcodeColors/issues/88)" was raised on the venerable [XcodeColors](https://github.com/robbiehanson/XcodeColors) project. Since then we've been limited to using emojis to add color to our console. 18 | 19 | Recently I wondered, has the answer been staring us in the face all that time. While Xcode doesn't allow styled text, it does respect colored glyphes such as 😊. That very ticket makes a bunch of suggestions for using them in the console. 20 | 21 | `ColoredConsole-Bold` is a font, based on [FiraMono-Bold](http://mozilla.github.io/Fira/) which adds ligatures for enabling colored variants of the ASCII character set. Here's the default color range: 22 | 23 |

24 | 25 | The 5 colors are enabled by suffixing the character with one of the [Variation Selectors](https://en.wikipedia.org/wiki/Variation_Selectors_(Unicode_block)) 6-10 (FE06, FE07, FE08, FE09 and FE0A). 26 | 27 | ## Changing the colors 28 | 29 | You can have different colors and modifier codepoints by changing and running `./colorify.pl`. I have not documented this (yet). -------------------------------------------------------------------------------- /color-range.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjrscott/ColoredConsole/da8f1032b0678e1e90ad44e3589f7529d1dd7f83/color-range.png -------------------------------------------------------------------------------- /colorify.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use Data::Dumper; 5 | use Getopt::Long; 6 | 7 | my %codeColors = 8 | ( 9 | "0xFE06" => "#DB2C38", 10 | "0xFE07" => "#41B645", 11 | "0xFE08" => "#C67C48", 12 | "0xFE09" => "#00A0BE", 13 | "0xFE0A" => "#B21889", 14 | ); 15 | 16 | foreach my $fontName ("ColoredConsole-Bold") 17 | { 18 | my $content = read_file('UTF-8', $fontName.".ttx"); 19 | 20 | my @glypIds = $content =~ m~~g; 21 | 22 | # die Dumper(\@glypIds); 23 | 24 | my $numPaletteEntries = keys %codeColors; 25 | 26 | my $extraGlyphIDs = ""; 27 | my $extraMetrics = ""; 28 | my $extraMaps = ""; 29 | my $extraGlyphs = ""; 30 | my $ligatureSets = ""; 31 | my $colorGlyphs = ""; 32 | my $colors = ""; 33 | 34 | my $colorIndex = 0; 35 | foreach my $code (sort keys %codeColors) 36 | { 37 | $extraGlyphIDs .= sprintf qq( \n), $code; 38 | $extraMetrics .= sprintf qq( \n), $code; 39 | $extraMaps .= sprintf qq( \n), $code, $code; 40 | $extraGlyphs .= sprintf qq( \n), $code; 41 | $colors .= sprintf qq( \n), $colorIndex++, $codeColors{$code}; 42 | } 43 | 44 | foreach my $glypId (@glypIds) 45 | { 46 | $ligatureSets .= sprintf qq( \n), $glypId; 47 | my $colorIndex = 0; 48 | foreach my $code (sort keys %codeColors) 49 | { 50 | $extraGlyphIDs .= sprintf qq( \n), $glypId, $code; 51 | $extraMetrics .= sprintf qq( \n), $glypId, $code; 52 | $extraGlyphs .= sprintf qq( \n), $glypId, $code; 53 | $ligatureSets .= sprintf qq( \n), $code, $glypId, $code; 54 | $colorGlyphs .= sprintf qq( \n), $glypId, $code, $colorIndex++, $glypId; 55 | } 56 | $ligatureSets .= sprintf qq( \n); 57 | } 58 | 59 | 60 | 61 | 62 | $content =~ s~ \n~$extraGlyphIDs~; 63 | $content =~ s~ \n~$extraMetrics~; 64 | $content =~ s~ \n~$extraMaps~; 65 | $content =~ s~ \n~$extraGlyphs~; 66 | $content =~ s~ \n~$ligatureSets~; 67 | $content =~ s~ \n~$colorGlyphs~; 68 | $content =~ s~ \n~$colors~; 69 | $content =~ s~~~; 70 | 71 | 72 | 73 | 74 | write_file('UTF-8', $fontName.".colored.ttx", $content); 75 | 76 | 77 | system "ttx", "-o", $fontName.".ttf", $fontName.".colored.ttx"; 78 | 79 | 80 | 81 | 82 | 83 | } 84 | 85 | 86 | 87 | 88 | sub read_file 89 | { 90 | my ($encoding, $path) = @_; 91 | open(my($file), '<:encoding('.$encoding.')', $path) || die "error $!: $path\n"; 92 | my $content = ""; 93 | while(<$file>) { 94 | $content .= $_; 95 | } 96 | close $file; 97 | return $content; 98 | } 99 | 100 | sub write_file 101 | { 102 | my ($encoding, $path, $content) = @_; 103 | if (defined $content) 104 | { 105 | my $parentPath = $path; 106 | $parentPath =~ s!/?[^/]*$!!; 107 | 108 | if (length $parentPath && !-e $parentPath) 109 | { 110 | system "mkdir", "-p", $parentPath; 111 | } 112 | 113 | if (!-e $path || read_file($encoding, $path) ne $content) 114 | { 115 | open(my($file), '>:encoding('.$encoding.')', $path) || die "error $!: $path\n"; 116 | print $file $content; 117 | close $file; 118 | } 119 | } 120 | elsif (-e $path) 121 | { 122 | system "rm", "-f", $path; 123 | } 124 | } -------------------------------------------------------------------------------- /xcode-console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjrscott/ColoredConsole/da8f1032b0678e1e90ad44e3589f7529d1dd7f83/xcode-console.png -------------------------------------------------------------------------------- /xcode-preferences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjrscott/ColoredConsole/da8f1032b0678e1e90ad44e3589f7529d1dd7f83/xcode-preferences.png --------------------------------------------------------------------------------