This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Creates color with corrected brightness. | |
/// </summary> | |
/// <param name="color">Color to correct.</param> | |
/// <param name="correctionFactor">The brightness correction factor. Must be between -1 and 1. | |
/// Negative values produce darker colors.</param> | |
/// <returns> | |
/// Corrected <see cref="Color"/> structure. | |
/// </returns> | |
public static Color ChangeColorBrightness(Color color, float correctionFactor) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Creates a RegExp from the given string, converting asterisks to .* expressions, | |
* and escaping all other characters. | |
*/ | |
function wildcardToRegExp (s) { | |
return new RegExp('^' + s.split(/\*+/).map(regExpEscape).join('.*') + '$'); | |
} | |
/** | |
* RegExp-escapes all characters in the given string. |