Android 11 デベロッパー プレビュー 2 が公開されました。ぜひお試しのうえ、フィードバックをお寄せください

Filter

interface Filter
androidx.palette.graphics.Palette.Filter

A Filter provides a mechanism for exercising fine-grained control over which colors are valid within a resulting Palette.

Summary

Public methods

abstract Boolean
isAllowed(rgb: Int, @NonNull hsl: FloatArray)

Hook to allow clients to be able filter colors from resulting palette.

Public methods

isAllowed

abstract fun isAllowed(
    rgb: Int,
    @NonNull hsl: FloatArray
): Boolean

Hook to allow clients to be able filter colors from resulting palette.

Parameters
rgb Int: the color in RGB888.
hsl FloatArray: HSL representation of the color.
Return
Boolean true if the color is allowed, false if not.