Class Palette

Definition

Namespace:
Tizen.NUI
Assembly:
Tizen.NUI.dll
API Level:
9

A helper class to extract prominent colors from an image.

A number of colors with different profiles are extracted from the image: Vibrant, Vibrant Dark, Vibrant Light, Muted, Muted Dark, Muted Light

These can be retrieved from the appropriate getter method.

C#
Copy
public sealed class Palette : object
Inheritance
Palette

Methods

View Source

Generate(PixelBuffer)

Generate a Palette synchronously using pixelBuffer as source.

Declaration
C#
Copy
public static Palette Generate(PixelBuffer pixelBuffer)
Parameters
Type Name Description
PixelBuffer pixelBuffer

A Target image's pixelBuffer.

Returns
Type Description
Palette

the palette instance.

API Level: 9
View Source

Generate(PixelBuffer, Rectangle)

Generate a Palette synchronously using pixelBuffer as source. And set a region of the pixelBuffer to be used exclusively when calculating the palette.

Declaration
C#
Copy
public static Palette Generate(PixelBuffer pixelBuffer, Rectangle region)
Parameters
Type Name Description
PixelBuffer pixelBuffer

A Target image's pixelBuffer.

Rectangle region

A rectangle used for region.

Returns
Type Description
Palette

the palette instance.

API Level: 9
View Source

GenerateAsync(PixelBuffer)

Generate a Palette asynchronously using bitmap as source.

Declaration
C#
Copy
public static Task<Palette> GenerateAsync(PixelBuffer pixelBuffer)
Parameters
Type Name Description
PixelBuffer pixelBuffer

A Target image's pixelBuffer.

Returns
Type Description
Task<Palette>

A task that represents the asynchronous pixelBuffer generate operation.

API Level: 9
View Source

GenerateAsync(PixelBuffer, Rectangle)

Generate a Palette asynchronously using pixelBuffer as source. And set a region of the pixelBuffer to be used exclusively when calculating the palette.

Declaration
C#
Copy
public static Task<Palette> GenerateAsync(PixelBuffer pixelBuffer, Rectangle region)
Parameters
Type Name Description
PixelBuffer pixelBuffer

A Target image's pixelBuffer.

Rectangle region

A rectangle used for region.

Returns
Type Description
Task<Palette>

A task that represents the asynchronous pixelBuffer generate operation.

API Level: 9
View Source

GetDarkMutedSwatch()

Returns a muted and dark swatch from the palette. Might be null.

Declaration
C#
Copy
public Palette.Swatch GetDarkMutedSwatch()
Returns
Type Description
Palette.Swatch

The swatch instance

API Level: 9
View Source

GetDarkVibrantSwatch()

Returns a dark and vibrant swatch from the palette. Might be null.

Declaration
C#
Copy
public Palette.Swatch GetDarkVibrantSwatch()
Returns
Type Description
Palette.Swatch

The swatch instance

API Level: 9
View Source

GetDominantSwatch()

Returns the dominant swatch from the palette. The dominant swatch is defined as the swatch with the greatest population (frequency) within the palette.

Declaration
C#
Copy
public Palette.Swatch GetDominantSwatch()
Returns
Type Description
Palette.Swatch

The swatch instance

API Level: 9
View Source

GetLightMutedSwatch()

Returns a muted and light swatch from the palette. Might be null.

Declaration
C#
Copy
public Palette.Swatch GetLightMutedSwatch()
Returns
Type Description
Palette.Swatch

The swatch instance

API Level: 9
View Source

GetLightVibrantSwatch()

Returns a light and vibrant swatch from the palette. Might be null.

Declaration
C#
Copy
public Palette.Swatch GetLightVibrantSwatch()
Returns
Type Description
Palette.Swatch

The swatch instance

API Level: 9
View Source

GetMutedSwatch()

Returns a muted swatch from the palette. Might be null.

Declaration
C#
Copy
public Palette.Swatch GetMutedSwatch()
Returns
Type Description
Palette.Swatch

The swatch instance

API Level: 9
View Source

GetSwatches()

Returns all of the swatches which make up the palette.

Declaration
C#
Copy
public IReadOnlyCollection<Palette.Swatch> GetSwatches()
Returns
Type Description
IReadOnlyCollection<Palette.Swatch>

The swatch list

API Level: 9
View Source

GetVibrantSwatch()

Returns the most vibrant swatch in the palette. Might be null.

Declaration
C#
Copy
public Palette.Swatch GetVibrantSwatch()
Returns
Type Description
Palette.Swatch

The swatch instance

API Level: 9

Extension Methods