color-scheme
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
matplotlib generic colormap from tab10
You may use the HSV system to obtain differently saturated and luminated colors for the same hue. Suppose you have at most 10 categories, then the tab10 map can be used to get a certain number of base colors. From those you can choose a couple of lighter shades for the subcategories. The following would … Read more
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
Mixing two colors “naturally” in javascript
I dedicated 3-4 days to this question. It’s a really complex problem. Here is what you can do if you want to mix two colors “naturally”: CMYK mixing: it’s not the perfect solution, but if you need a solution now, and you don’t want to spend months with learning about the subject, experimenting and coding, … Read more
iOS – color on Xcode simulator is different from the color on device
Credit goes to @jtbandes for suggesting to send screenshots which led to the solution I am just answering the question for completeness. Steps I followed: Take a screenshot of image in storyboard Take a screenshot of image in device (use mail / photo stream back to your mac) Use color picker (part of mac OS … 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