@OPEN-KAPPA/COLORS
    Preparing search index...

    Type Alias ExtractionOptions

    Options for the color extraction.

    type ExtractionOptions = {
        count: number;
        distance: KMeansDistance;
        maxIterations: number;
        sampleFactor: number;
        sortBy: "dominance" | "vibrance";
    }
    Index

    Properties

    count: number

    The number of colors to extract. Default is 5.

    distance: KMeansDistance

    Which distance algorithm to use. Default is Euclidean (DeltaE 76) on Lab space. WARNING: Using complex metrics like DeltaE 2000 will significantly impact performance.

    maxIterations: number

    Max iterations for the K-Means algorithm. Default is 10.

    sampleFactor: number

    The sampling quality. 1 = Check every pixel (Slowest). 10 = Check every 10th pixel (Fast). Default is 10.

    sortBy: "dominance" | "vibrance"

    How to sort the resulting palette.

    • dominance: Sort by pixel count.
    • vibrance: Sort by a mix of saturation and luminance. Default is dominance.