Freigeben über


ColorUtilities Class

Definition

public static class ColorUtilities
type ColorUtilities = class
Public Module ColorUtilities
Inheritance
ColorUtilities

Methods

Blend(Color, Color)

Computes the result of alpha-blending this color over the background using the algorithm described at https://en.wikipedia.org/wiki/Alpha_compositing.

CompareContrastWithBlackAndWhite(Color)

Calculates the contrast ratio of the specified color against both black and white and returns which one has better contrast ratio.

GetBrushFromCache(Color)

Get a brush that corresponds to a color. The brushes are stored in a cache.

GetContrastRatio(Color, Color)

Returns the contrast ratio between foreground and background. according to https://www.w3.org/TR/WCAG20/#contrast-ratiodef.

GetLuminance(Color)

Gets the luminance of a color in sRGB colorspace according to https://www.w3.org/TR/WCAG20/#relativeluminancedef

Applies to