Colors in Visual Studio Extension

Yes, binding to static VS resources is the best approach. It is supported in VS 2012+ and looks like this: <ResourceDictionary xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation” xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” xmlns:vs_shell=”clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.11.0″> <Style TargetType=”Label”> <Setter Property=”Foreground” Value=”{DynamicResource {x:Static vs_shell:EnvironmentColors.ToolWindowTextBrushKey}}”/> </Style> <Style TargetType=”TextBox”> <Setter Property=”Foreground” Value=”{DynamicResource {x:Static vs_shell:EnvironmentColors.ToolWindowTextBrushKey}}”/> <Setter Property=”Background” Value=”{DynamicResource {x:Static vs_shell:EnvironmentColors.ToolWindowBackgroundBrushKey}}”/> </Style> </ResourceDictionary> See EnvironmentColors Class for all avilable colors.

Syntax highlighting/colorizing cat

I’d recommend pygmentize from the python package python-pygments. You may want to define the following handy alias (unless you use ccat from the ccrypt package). alias ccat=”pygmentize -g” And if you want line numbers: alias ccat=”pygmentize -g -O style=colorful,linenos=1″ Add one of these above commands to ~/.bash_aliases for permanent effect

Stacked barplot with colour gradients for each bar

I have made a function ColourPalleteMulti, which lets you create a multiple colour pallete based on subgroups within your data: ColourPalleteMulti <- function(df, group, subgroup){ # Find how many colour categories to create and the number of colours in each categories <- aggregate(as.formula(paste(subgroup, group, sep=”~” )), df, function(x) length(unique(x))) category.start <- (scales::hue_pal(l = 100)(nrow(categories))) # … Read more

How to automatically generate N “distinct” colors?

This questions appears in quite a few SO discussions: Algorithm For Generating Unique Colors Generate unique colours Generate distinctly different RGB colors in graphs How to generate n different colors for any natural number n? Different solutions are proposed, but none are optimal. Luckily, science comes to the rescue Arbitrary N Colour displays for categorical … Read more