Partager via


ColorObject.Convert Method

Definition

Overloads

Convert(Single, Single, Single, Single, ColorSpace+Connector)

Converts the specified 3 component color from the source color space to the destination color space.

Convert(Single, Single, Single, Single, ColorSpace, ColorSpace)

Converts the specified 3 component color from the source color space to the destination color space.

Convert(Int64, ColorSpace+Connector)

Converts the specified 3 component color from the source color space to the destination color space.

Convert(Int64, ColorSpace)

Converts the specified color long from its color space into the specified destination color space.

Convert(Color, ColorSpace)

Converts the specified ARGB color int from the ColorSpace.Named#SRGB sRGB color space into the specified destination color space.

Convert(ColorSpace)

Converts this color from its color space to the specified color space.

Convert(Single, Single, Single, Single, ColorSpace+Connector)

Converts the specified 3 component color from the source color space to the destination color space.

[Android.Runtime.Register("convert", "(FFFFLandroid/graphics/ColorSpace$Connector;)J", "", ApiSince=26)]
public static long Convert (float r, float g, float b, float a, Android.Graphics.ColorSpace.Connector connector);
[<Android.Runtime.Register("convert", "(FFFFLandroid/graphics/ColorSpace$Connector;)J", "", ApiSince=26)>]
static member Convert : single * single * single * single * Android.Graphics.ColorSpace.Connector -> int64

Parameters

r
Single

The red component of the color to convert

g
Single

The green component of the color to convert

b
Single

The blue component of the color to convert

a
Single

The alpha component of the color to convert, in ([0..1])

Returns

A color long in the destination color space

Attributes

Remarks

Java documentation for android.graphics.Color.convert(float, float, float, float, android.graphics.ColorSpace, android.graphics.ColorSpace).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Convert(Single, Single, Single, Single, ColorSpace, ColorSpace)

Converts the specified 3 component color from the source color space to the destination color space.

[Android.Runtime.Register("convert", "(FFFFLandroid/graphics/ColorSpace;Landroid/graphics/ColorSpace;)J", "", ApiSince=26)]
public static long Convert (float r, float g, float b, float a, Android.Graphics.ColorSpace source, Android.Graphics.ColorSpace destination);
[<Android.Runtime.Register("convert", "(FFFFLandroid/graphics/ColorSpace;Landroid/graphics/ColorSpace;)J", "", ApiSince=26)>]
static member Convert : single * single * single * single * Android.Graphics.ColorSpace * Android.Graphics.ColorSpace -> int64

Parameters

r
Single

The red component of the color to convert

g
Single

The green component of the color to convert

b
Single

The blue component of the color to convert

a
Single

The alpha component of the color to convert, in ([0..1])

source
ColorSpace

The source color space, cannot be null

destination
ColorSpace

The destination color space, cannot be null

Returns

A color long in the destination color space

Attributes

Remarks

Converts the specified 3 component color from the source color space to the destination color space. The resulting color is returned as a color long. See the documentation of this class for a description of the color long format.

When converting multiple colors in a row, it is recommended to use #convert(float, float, float, float, ColorSpace.Connector) instead to avoid the creation of a ColorSpace.Connector on every invocation.

The red, green and blue components must be in the range defined by the specified color space. See ColorSpace#getMinValue(int) and ColorSpace#getMaxValue(int).

Java documentation for android.graphics.Color.convert(float, float, float, float, android.graphics.ColorSpace, android.graphics.ColorSpace).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Convert(Int64, ColorSpace+Connector)

Converts the specified 3 component color from the source color space to the destination color space.

[Android.Runtime.Register("convert", "(JLandroid/graphics/ColorSpace$Connector;)J", "", ApiSince=26)]
public static long Convert (long color, Android.Graphics.ColorSpace.Connector connector);
[<Android.Runtime.Register("convert", "(JLandroid/graphics/ColorSpace$Connector;)J", "", ApiSince=26)>]
static member Convert : int64 * Android.Graphics.ColorSpace.Connector -> int64

Parameters

color
Int64

Returns

A color long in the destination color space

Attributes

Remarks

Java documentation for android.graphics.Color.convert(float, float, float, float, android.graphics.ColorSpace, android.graphics.ColorSpace).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Convert(Int64, ColorSpace)

Converts the specified color long from its color space into the specified destination color space.

[Android.Runtime.Register("convert", "(JLandroid/graphics/ColorSpace;)J", "", ApiSince=26)]
public static long Convert (long color, Android.Graphics.ColorSpace colorSpace);
[<Android.Runtime.Register("convert", "(JLandroid/graphics/ColorSpace;)J", "", ApiSince=26)>]
static member Convert : int64 * Android.Graphics.ColorSpace -> int64

Parameters

color
Int64

The color long to convert

colorSpace
ColorSpace

The destination color space

Returns

A color long in the destination color space

Attributes

Remarks

Converts the specified color long from its color space into the specified destination color space. The resulting color is returned as a color long. See the documentation of this class for a description of the color long format.

When converting several colors in a row, it is recommended to use #convert(long, ColorSpace.Connector) instead to avoid the creation of a ColorSpace.Connector on every invocation.

Java documentation for android.graphics.Color.convert(long, android.graphics.ColorSpace).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Convert(Color, ColorSpace)

Converts the specified ARGB color int from the ColorSpace.Named#SRGB sRGB color space into the specified destination color space.

[Android.Runtime.Register("convert", "(ILandroid/graphics/ColorSpace;)J", "", ApiSince=26)]
public static long Convert (Android.Graphics.Color color, Android.Graphics.ColorSpace colorSpace);
[<Android.Runtime.Register("convert", "(ILandroid/graphics/ColorSpace;)J", "", ApiSince=26)>]
static member Convert : Android.Graphics.Color * Android.Graphics.ColorSpace -> int64

Parameters

color
Color

The sRGB color int to convert

colorSpace
ColorSpace

The destination color space

Returns

A color long in the destination color space

Attributes

Remarks

Converts the specified ARGB color int from the ColorSpace.Named#SRGB sRGB color space into the specified destination color space. The resulting color is returned as a color long. See the documentation of this class for a description of the color long format.

Java documentation for android.graphics.Color.convert(int, android.graphics.ColorSpace).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Convert(ColorSpace)

Converts this color from its color space to the specified color space.

[Android.Runtime.Register("convert", "(Landroid/graphics/ColorSpace;)Landroid/graphics/Color;", "GetConvert_Landroid_graphics_ColorSpace_Handler", ApiSince=26)]
public virtual Android.Graphics.ColorObject Convert (Android.Graphics.ColorSpace colorSpace);
[<Android.Runtime.Register("convert", "(Landroid/graphics/ColorSpace;)Landroid/graphics/Color;", "GetConvert_Landroid_graphics_ColorSpace_Handler", ApiSince=26)>]
abstract member Convert : Android.Graphics.ColorSpace -> Android.Graphics.ColorObject
override this.Convert : Android.Graphics.ColorSpace -> Android.Graphics.ColorObject

Parameters

colorSpace
ColorSpace

The destination color space, cannot be null

Returns

A non-null color instance in the specified color space

Attributes

Remarks

Converts this color from its color space to the specified color space. The conversion is done using the default rendering intent as specified by ColorSpace#connect(ColorSpace, ColorSpace).

Java documentation for android.graphics.Color.convert(android.graphics.ColorSpace).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to