Class Palette
Definition
- Assembly:
- Tizen.NUI.dll
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.
public sealed class Palette
- Inheritance
-
objectPalette
Methods
View SourceGenerate(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
public static Palette Generate(PixelBuffer pixelBuffer, Rectangle region)
Parameters
Type | Name | Description |
---|---|---|
Tizen.NUI.PixelBuffer | pixelBuffer | A Target image's pixelBuffer. |
Rectangle | region | A rectangle used for region. |
Returns
Type | Description |
---|---|
Palette | the palette instance. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when the argument pixelBuffer is null. |
Generate(PixelBuffer)
Generate a Palette synchronously using pixelBuffer as source.
Declaration
public static Palette Generate(PixelBuffer pixelBuffer)
Parameters
Type | Name | Description |
---|---|---|
Tizen.NUI.PixelBuffer | pixelBuffer | A Target image's pixelBuffer. |
Returns
Type | Description |
---|---|
Palette | the palette instance. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when the argument pixelBuffer is null. |
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
public static Task<Palette> GenerateAsync(PixelBuffer pixelBuffer, Rectangle region)
Parameters
Type | Name | Description |
---|---|---|
Tizen.NUI.PixelBuffer | pixelBuffer | A Target image's pixelBuffer. |
Rectangle | region | A rectangle used for region. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TResult><Palette> | A task that represents the asynchronous pixelBuffer generate operation. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when the argument pixelBuffer is null. |
GenerateAsync(PixelBuffer)
Generate a Palette asynchronously using bitmap as source.
Declaration
public static Task<Palette> GenerateAsync(PixelBuffer pixelBuffer)
Parameters
Type | Name | Description |
---|---|---|
Tizen.NUI.PixelBuffer | pixelBuffer | A Target image's pixelBuffer. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TResult><Palette> | A task that represents the asynchronous pixelBuffer generate operation. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when the argument pixelBuffer is null. |
GetDarkMutedSwatch()
Returns a muted and dark swatch from the palette. Might be null.
Declaration
public Palette.Swatch GetDarkMutedSwatch()
Returns
Type | Description |
---|---|
Palette.Swatch | The swatch instance |
GetDarkVibrantSwatch()
Returns a dark and vibrant swatch from the palette. Might be null.
Declaration
public Palette.Swatch GetDarkVibrantSwatch()
Returns
Type | Description |
---|---|
Palette.Swatch | The swatch instance |
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
public Palette.Swatch GetDominantSwatch()
Returns
Type | Description |
---|---|
Palette.Swatch | The swatch instance |
GetLightMutedSwatch()
Returns a muted and light swatch from the palette. Might be null.
Declaration
public Palette.Swatch GetLightMutedSwatch()
Returns
Type | Description |
---|---|
Palette.Swatch | The swatch instance |
GetLightVibrantSwatch()
Returns a light and vibrant swatch from the palette. Might be null.
Declaration
public Palette.Swatch GetLightVibrantSwatch()
Returns
Type | Description |
---|---|
Palette.Swatch | The swatch instance |
GetMutedSwatch()
Returns a muted swatch from the palette. Might be null.
Declaration
public Palette.Swatch GetMutedSwatch()
Returns
Type | Description |
---|---|
Palette.Swatch | The swatch instance |
GetSwatches()
Returns all of the swatches which make up the palette.
Declaration
public IReadOnlyCollection<Palette.Swatch> GetSwatches()
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyCollection<T><Palette.Swatch> | The swatch list |
GetVibrantSwatch()
Returns the most vibrant swatch in the palette. Might be null.
Declaration
public Palette.Swatch GetVibrantSwatch()
Returns
Type | Description |
---|---|
Palette.Swatch | The swatch instance |