Skip to content

Commit 5a651aa

Browse files
authored
Enabling fading out colors for alternate mode (#34)
1 parent efc2ddc commit 5a651aa

26 files changed

+717
-450
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
### Visual Studio extension for colorization of indent levels.
77
You can download the latest version of this extension on the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=chingucoding.IndentRainbow).
8+
Screenshots of the extension can be found in <a></a>[this folder](./docs) or on the extension page linked above.
89

910
### Summary
1011
The aim of this extension is to make it easier to differentiate different levels of indentation in your source code.
21 KB
Loading
19.9 KB
Loading
20.8 KB
Loading
19.7 KB
Loading

src/IndentRainbow.Extension/Classification/Indent.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public Indent(IWpfTextView view, ITextDocumentFactoryService textDocumentFactory
6565
this.view.LayoutChanged += OnLayoutChanged;
6666
drawer = new BackgroundTextIndexDrawer(layer, this.view);
6767

68-
colorGetter = new RainbowBrushGetter(OptionsManager.colors.Get(), OptionsManager.errorBrush.Get(), OptionsManager.colorMode.Get());
68+
colorGetter = new RainbowBrushGetter(OptionsManager.colors.Get(), OptionsManager.errorBrush.Get(), OptionsManager.colorMode.Get(), OptionsManager.fadeColors.Get());
6969
validator = new IndentValidator(
7070
OptionsManager.indentSize.Get()
7171
);
@@ -81,24 +81,24 @@ public Indent(IWpfTextView view, ITextDocumentFactoryService textDocumentFactory
8181
validator = new IndentValidator(OptionsManager.fileExtensionsDictionary.Get()[extension]);
8282
}
8383
}
84+
var highlightingMode = OptionsManager.highlightingMode.Get();
8485

85-
if (OptionsManager.highlightingMode.Get() == HighlightingMode.Alternating)
86+
if (OptionsManager.highlightingMode.Get() == HighlightingMode.Monocolor)
8687
{
87-
decorator = new AlternatingLineDecorator(
88+
decorator = new MonocolorLineDecorator(
8889
drawer, colorGetter, validator)
8990
{
9091
detectErrors = OptionsManager.detectErrors.Get()
9192
};
9293
}
93-
if (OptionsManager.highlightingMode.Get() == HighlightingMode.Monocolor)
94+
else
9495
{
95-
decorator = new MonocolorLineDecorator(
96+
decorator = new AlternatingLineDecorator(
9697
drawer, colorGetter, validator)
9798
{
9899
detectErrors = OptionsManager.detectErrors.Get()
99100
};
100101
}
101-
102102
}
103103

104104
/// <summary>

0 commit comments

Comments
 (0)