-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathSCXcodeMinimapTheme.m
More file actions
63 lines (46 loc) · 3.02 KB
/
SCXcodeMinimapTheme.m
File metadata and controls
63 lines (46 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//
// SCXcodeMinimapTheme.m
// SCXcodeMinimap
//
// Created by Stefan Ceriu on 5/24/15.
// Copyright (c) 2015 Stefan Ceriu. All rights reserved.
//
#import "SCXcodeMinimapTheme.h"
#import "DVTSourceNodeTypes.h"
#import "DVTPointerArray.h"
const CGFloat kBackgroundColorShadowLevel = 0.1f;
static NSString * const kXcodeSyntaxCommentNodeName = @"xcode.syntax.comment";
static NSString * const kXcodeSyntaxPreprocessorNodeName = @"xcode.syntax.preprocessor";
@implementation SCXcodeMinimapTheme
+ (SCXcodeMinimapTheme *)minimapThemeWithTheme:(DVTFontAndColorTheme *)theme
{
SCXcodeMinimapTheme *minimapTheme = [[SCXcodeMinimapTheme alloc] init];
minimapTheme.dvtTheme = theme;
minimapTheme.backgroundColor = [theme.sourceTextBackgroundColor shadowWithLevel:kBackgroundColorShadowLevel];
minimapTheme.selectionColor = [NSColor colorWithCalibratedRed:(1.0f - [minimapTheme.backgroundColor redComponent])
green:(1.0f - [minimapTheme.backgroundColor greenComponent])
blue:(1.0f - [minimapTheme.backgroundColor blueComponent])
alpha:0.2f];
minimapTheme.sourcePlainTextColor = theme.sourcePlainTextColor;
minimapTheme.sourceTextBackgroundColor = theme.sourceTextBackgroundColor;
DVTPointerArray *colors = [theme syntaxColorsByNodeType];
minimapTheme.commentBackgroundColor = [colors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName]];
minimapTheme.commentBackgroundColor = [NSColor colorWithCalibratedRed:minimapTheme.commentBackgroundColor.redComponent
green:minimapTheme.commentBackgroundColor.greenComponent
blue:minimapTheme.commentBackgroundColor.blueComponent
alpha:0.3f];
minimapTheme.preprocessorBackgroundColor = [colors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]];
minimapTheme.preprocessorBackgroundColor = [NSColor colorWithCalibratedRed:minimapTheme.preprocessorBackgroundColor.redComponent
green:minimapTheme.preprocessorBackgroundColor.greenComponent
blue:minimapTheme.preprocessorBackgroundColor.blueComponent
alpha:0.3f];
minimapTheme.enabledBreakpointColor = [NSColor colorWithRed:65.0f/255.0f green:113.0f/255.0f blue:200.0f/255.0f alpha:1.0f];
minimapTheme.disabledBreakpointColor = [NSColor colorWithRed:65.0f/255.0f green:113.0f/255.0f blue:200.0f/255.0f alpha:0.5f];
minimapTheme.buildIssueWarningBackgroundColor = [NSColor colorWithRed:1.0f green:1.0f blue:0.0f alpha:0.75f];
minimapTheme.buildIssueErrorBackgroundColor = [NSColor colorWithRed:1.0f green:0.0f blue:0.0f alpha:0.75f];
minimapTheme.highlightedSymbolBackgroundColor = [NSColor colorWithRed:255.0f/255.0f green:29.0f/255.0f blue:21.0f/255.0f alpha:0.75f];
minimapTheme.searchResultForegroundColor = [minimapTheme.sourcePlainTextColor colorWithAlphaComponent:0.25f];
minimapTheme.searchResultBackgroundColor = [NSColor colorWithRed:255.0f/255.0f green:29.0f/255.0f blue:21.0f/255.0f alpha:0.75f];
return minimapTheme;
}
@end