PredominantColor

class PredominantColor(swatches: PredominantColorProcessor.Swatch) : Processor

The PredominantColorProcessor acts like a "Color Sensor", allowing you to define a Region of Interest (ROI) of the camera stream inside of which the dominant color is found. Additionally, the detected color is matched to one of the Swatches specified by the user as a "best guess" at the general shade of the color.

Constructors

Link copied to clipboard
constructor(vararg swatches: PredominantColorProcessor.Swatch)

Properties

Link copied to clipboard
open override val processor: PredominantColorProcessor

Functions

Link copied to clipboard
fun getAnalysis(): PredominantColorProcessor.Result

Get the full analysis result including closest swatch and color values.

Link copied to clipboard
fun getClosestSwatch(): PredominantColorProcessor.Swatch?

Get the closest matching swatch to the predominant color.

Link copied to clipboard

Get HSV color values Hue 0-180, Saturation 0-255, Value 0-255.

Link copied to clipboard

Get RGB color values Red 0-255, Green 0-255, Blue 0-255.

Link copied to clipboard

Get YCrCb color values Y 0-255, Cr 0-255, Cb 0-255.

Link copied to clipboard
fun isColor(swatch: PredominantColorProcessor.Swatch): Boolean

Check if the detected color matches a specific swatch.