Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Color.FromAValues Method (Single, Single(), Uri)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Creates a new Color structure by using the specified alpha channel, color channel values, and color profile.

Namespace:   System.Windows.Media
Assembly:  PresentationCore (in PresentationCore.dll)

Public Shared Function FromAValues (
	a As Single,
	values As Single(),
	profileUri As Uri
) As Color

Parameters

a
Type: System.Single

The alpha channel for the new color,a value between 0 and 1.

values
Type: System.Single()

A collection of values that specify the color channels for the new color. These values map to the profileUri.

profileUri
Type: System.Uri

The International Color Consortium (ICC) or Image Color Management (ICM) color profile for the new color.

Return Value

Type: System.Windows.Media.Color

A Color structure with the specified values.

A International Color Consortium (ICC) or Image Color Management (ICM) color profile contains a color system profile for a particular application or device such as a color printer. This profile is matched to a common profile that in turn can be mapped to the individual profiles of other devices. This allows the color system used by one computer device to match the colors from other applications and devices on the same or other computer systems.

The following example shows how to use the FromAValues method to create a Color structure.

Private Function FromAValuesExample() As Color
	' Create a brown color using the FromAValues static method.
	Dim myAValuesColor As New Color()
	Dim colorValues(3) As Single
	colorValues(0) = 0.0f
	colorValues(1) = 0.5f
	colorValues(2) = 0.5f
	colorValues(3) = 0.5f

	' Uri to sample color profile. This color profile is used to 
	' determine what the colors the colorValues map to.
	Dim iccUri As New Uri("C:\sampleColorProfile.icc")

	' The FromAValues method requires an explicit value for alpha
	' (first parameter). The values given by the second parameter are
	' used with the color profile specified by the third parameter to 
	' determine the color.
	myAValuesColor = Color.FromAValues(1.0f, colorValues, iccUri)
	Return myAValuesColor
End Function

.NET Framework
Available since 3.0
Return to top
Show:
© 2017 Microsoft