Share via


ColorObject.ValueOf Method

Definition

Overloads

ValueOf(Color)

Creates a new Color instance from an ARGB color int.

ValueOf(Int64)

Creates a new Color instance from a color long.

ValueOf(Single[], ColorSpace)

Creates a new Color in the specified color space with the specified component values.

ValueOf(Single, Single, Single)

Creates a new opaque Color in the ColorSpace.Named#SRGB sRGB color space with the specified red, green and blue component values.

ValueOf(Single, Single, Single, Single)

Creates a new Color in the ColorSpace.Named#SRGB sRGB color space with the specified red, green, blue and alpha component values.

ValueOf(Single, Single, Single, Single, ColorSpace)

Creates a new Color in the specified color space with the specified red, green, blue and alpha component values.

ValueOf(Color)

Creates a new Color instance from an ARGB color int.

[Android.Runtime.Register("valueOf", "(I)Landroid/graphics/Color;", "", ApiSince=26)]
public static Android.Graphics.ColorObject ValueOf (Android.Graphics.Color color);
[<Android.Runtime.Register("valueOf", "(I)Landroid/graphics/Color;", "", ApiSince=26)>]
static member ValueOf : Android.Graphics.Color -> Android.Graphics.ColorObject

Parameters

color
Color

The ARGB color int to create a Color from

Returns

A non-null instance of Color

Attributes

Remarks

Creates a new Color instance from an ARGB color int. The resulting color is in the ColorSpace.Named#SRGB sRGB color space.

Java documentation for android.graphics.Color.valueOf(int).

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

ValueOf(Int64)

Creates a new Color instance from a color long.

[Android.Runtime.Register("valueOf", "(J)Landroid/graphics/Color;", "", ApiSince=26)]
public static Android.Graphics.ColorObject ValueOf (long color);
[<Android.Runtime.Register("valueOf", "(J)Landroid/graphics/Color;", "", ApiSince=26)>]
static member ValueOf : int64 -> Android.Graphics.ColorObject

Parameters

color
Int64

The color long to create a Color from

Returns

A non-null instance of Color

Attributes

Remarks

Creates a new Color instance from a color long. The resulting color is in the same color space as the specified color long.

Java documentation for android.graphics.Color.valueOf(long).

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

ValueOf(Single[], ColorSpace)

Creates a new Color in the specified color space with the specified component values.

[Android.Runtime.Register("valueOf", "([FLandroid/graphics/ColorSpace;)Landroid/graphics/Color;", "", ApiSince=26)]
public static Android.Graphics.ColorObject ValueOf (float[] components, Android.Graphics.ColorSpace colorSpace);
[<Android.Runtime.Register("valueOf", "([FLandroid/graphics/ColorSpace;)Landroid/graphics/Color;", "", ApiSince=26)>]
static member ValueOf : single[] * Android.Graphics.ColorSpace -> Android.Graphics.ColorObject

Parameters

components
Single[]

The components of the color to create, with alpha as the last component

colorSpace
ColorSpace

The color space of the color to create

Returns

A non-null instance of Color

Attributes

Remarks

Creates a new Color in the specified color space with the specified component values. The range of the components is defined by ColorSpace#getMinValue(int) and ColorSpace#getMaxValue(int). The values passed to this method must be in the proper range. The alpha component is always in the range \([0..1]\).

The length of the array of components must be at least {@link ColorSpace#getComponentCount()} + 1. The component at index ColorSpace#getComponentCount() is always alpha.

Java documentation for android.graphics.Color.valueOf(float[], 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

ValueOf(Single, Single, Single)

Creates a new opaque Color in the ColorSpace.Named#SRGB sRGB color space with the specified red, green and blue component values.

[Android.Runtime.Register("valueOf", "(FFF)Landroid/graphics/Color;", "", ApiSince=26)]
public static Android.Graphics.ColorObject ValueOf (float r, float g, float b);
[<Android.Runtime.Register("valueOf", "(FFF)Landroid/graphics/Color;", "", ApiSince=26)>]
static member ValueOf : single * single * single -> Android.Graphics.ColorObject

Parameters

r
Single

The red component of the opaque sRGB color to create, in ([0..1])

g
Single

The green component of the opaque sRGB color to create, in ([0..1])

b
Single

The blue component of the opaque sRGB color to create, in ([0..1])

Returns

A non-null instance of Color

Attributes

Remarks

Creates a new opaque Color in the ColorSpace.Named#SRGB sRGB color space with the specified red, green and blue component values. The component values must be in the range \([0..1]\).

Java documentation for android.graphics.Color.valueOf(float, float, float).

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

ValueOf(Single, Single, Single, Single)

Creates a new Color in the ColorSpace.Named#SRGB sRGB color space with the specified red, green, blue and alpha component values.

[Android.Runtime.Register("valueOf", "(FFFF)Landroid/graphics/Color;", "", ApiSince=26)]
public static Android.Graphics.ColorObject ValueOf (float r, float g, float b, float a);
[<Android.Runtime.Register("valueOf", "(FFFF)Landroid/graphics/Color;", "", ApiSince=26)>]
static member ValueOf : single * single * single * single -> Android.Graphics.ColorObject

Parameters

r
Single

The red component of the sRGB color to create, in ([0..1])

g
Single

The green component of the sRGB color to create, in ([0..1])

b
Single

The blue component of the sRGB color to create, in ([0..1])

a
Single

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

Returns

A non-null instance of Color

Attributes

Remarks

Creates a new Color in the ColorSpace.Named#SRGB sRGB color space with the specified red, green, blue and alpha component values. The component values must be in the range \([0..1]\).

Java documentation for android.graphics.Color.valueOf(float, float, float, float).

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

ValueOf(Single, Single, Single, Single, ColorSpace)

Creates a new Color in the specified color space with the specified red, green, blue and alpha component values.

[Android.Runtime.Register("valueOf", "(FFFFLandroid/graphics/ColorSpace;)Landroid/graphics/Color;", "", ApiSince=26)]
public static Android.Graphics.ColorObject ValueOf (float r, float g, float b, float a, Android.Graphics.ColorSpace colorSpace);
[<Android.Runtime.Register("valueOf", "(FFFFLandroid/graphics/ColorSpace;)Landroid/graphics/Color;", "", ApiSince=26)>]
static member ValueOf : single * single * single * single * Android.Graphics.ColorSpace -> Android.Graphics.ColorObject

Parameters

r
Single

The red component of the color to create

g
Single

The green component of the color to create

b
Single

The blue component of the color to create

a
Single

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

colorSpace
ColorSpace

The color space of the color to create

Returns

A non-null instance of Color

Attributes

Remarks

Creates a new Color in the specified color space with the specified red, green, blue and alpha component values. The range of the components is defined by ColorSpace#getMinValue(int) and ColorSpace#getMaxValue(int). The values passed to this method must be in the proper range.

Java documentation for android.graphics.Color.valueOf(float, float, float, float, 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