Tutorial by Examples: color

Darken #demo { @refcolor: #f0b9b8; background: @refcolor; border: 1px solid darken(@refcolor, 25%); } The above code makes use of the darken() function to set the border color as a shade that is 25% darker than the reference color (which is also the background color). Less compiler ca...
This is how the author sets their personal PS1 variable: gitPS1(){ gitps1=$(git branch 2>/dev/null | grep '*') gitps1="${gitps1:+ (${gitps1/#\* /})}" echo "$gitps1" } #Please use the below function if you are a mac user gitPS1ForMac(){ git branch 2> ...
Use same UIImage with multiple theme base app by just applying UIColor to UIImage instance as following. // *** Create an UIImage instance with RenderingMode AlwaysTemplate *** UIImage *imgMenu = [[UIImage imageNamed:@"iconMenu"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]...
BufferedImage image = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB); //you don't have to use the Graphics object, you can read and set pixel color individually for (int i = 0; i < 256; i++) { for (int j = 0; j < 256; j++) { int alpha = 255; //don't forget this, or ...
Remove color from an image via ctx.globalCompositeOperation = 'color'; The amount of the effect can be controled with the alpha setting // Render the image ctx.globalCompositeOperation='source-atop'; ctx.drawImage(image, 0, 0); // set the composite operation ctx.globalCompositeOperation='...
Increase the saturation level of an image with ctx.globalCompositeOperation = 'saturation'; The amount of the effect can be controled with the alpha setting or the amount of saturation in the fill overlay // Render the image ctx.globalCompositeOperation='source-atop'; ctx.drawImage(image, 0, ...
Colored text can be created by passing the text and a font color name to the following function: private String getColoredSpanned(String text, String color) { String input = "<font color=" + color + ">" + text + "</font>"; return input; } The ...
Swift Add this extension to UIImage : extension UIImage { func maskWithColor(color: UIColor) -> UIImage? { let maskImage = self.CGImage let width = self.size.width let height = self.size.height let bounds = CGRectMake(0, 0, width, height) ...
If you have predefined ranges and want to use specific colors for those ranges you can declare custom colormap. For example: import matplotlib.pyplot as plt import numpy as np import matplotlib.colors x = np.linspace(-2,2,500) y = np.linspace(-2,2,500) XX, YY = np.meshgrid(x, y) Z = np.sin(...
#!/usr/bin/perl use Term::ANSIColor; print color("cyan"), "Hello", color("red"), "\tWorld", color("green"), "\tIt's Me!\n", color("reset");
To make the table more readable, following are the ways to color it: Rows Columns Lines Cells Coloring Rows Use \rowcolor (provided by colortbl; also loaded by xcolor under the [table] package option). Example: \documentclass{article} \usepackage[table]{xcolor} \begin{document} \be...
Given a non-empty cv::Mat img of some size, we can fill it to a solid color in several ways: img = cv::Scalar(blueVal,greenVal,redVal); or, the more general, mask supporting, cv::Mat::setTo(): img.setTo(cv::Scalar(blueVal,greenVal,redVal)); If you are using the older OpenCV C API with IplIma...
In the opening section of a bash script, it's possible to define some variables that function as helpers to color or otherwise format the terminal output during the run of the script. Different platforms use different character sequences to express color. However, there's a utility called tput whic...
Preset Ionic CSS will have a theme and pre-set colors for it. You can modify or override the basic values in the ionic.css or in your custom CSS file. You can also define these with SASS and to use SASS in Ionic you just need to run the ionic setup sass command in your terminal. Basic usage of colo...
Let's assume we have an entity status field with 3 options Tentative Pending Approved Our goal is to show different color for each status as follow: Tentative will be Red Pending will be Orange Approved will be Green The switch condition: =Switch(Fields!ItemStatus.Value = "Tentativ...
To quickly provide a matching color for links inside any alert, we can use the .alert-link utility class. <div class="alert alert-success"> You have won! Click <a href="#" class="alert-link">here</a> to claim your prize ... </div> <d...
Sometimes we want to give extra information to our user with colors (for example red means something wrong has happened) We can change toast message background color using setting a color filter to the view which our toast give us (here I use a ColorMatrixColorFilter): Toast t = Toast.MakeText(con...
[[UITabBar appearance] setTintColor:[UIColor whiteColor]]; [[UITabBar appearance] setBarTintColor:[UIColor tabBarBackgroundColor]]; [[UITabBar appearance] setBackgroundColor:[UIColor tabBarInactiveColor]]; [[UINavigationBar appearance] setBarTintColor:[UIColor appBlueColor]]; [[UINavigationBar a...
Xcode 8 will automatically recognize any images you’ve got in an Asset Catalog and offer them up as a suggestion inside of a UIImage initializer. So you could basically declare a new variable and then add an asset name that you have added to your asset catalog. For example let img = dog. img does n...
Objective-C //Displays the country pickerView with black background and white text [self. countryPicker setValue:[UIColor whiteColor] forKey:@"textColor"]; [self. countryPicker setValue:[UIColor blackColor] forKey:@"backgroundColor"]; Swift let color1 = UIColor(colorLitera...

Page 4 of 6