From 987c10e4128f75a31015e2b7a39ce744bc694952 Mon Sep 17 00:00:00 2001 From: Randy Tarampi Date: Tue, 28 Apr 2020 19:29:59 +0200 Subject: [PATCH] chore(typings): Add typings for `Image.dominantColor` per https://github.com/randytarampi/lwip/pull/30 and https://github.com/EyalAr/lwip/pull/255. --- typings.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/typings.d.ts b/typings.d.ts index e8d55c99..3411867d 100644 --- a/typings.d.ts +++ b/typings.d.ts @@ -365,6 +365,13 @@ export interface Image { */ height(): number; + /** + * Return the pixel color that occurs most frequently in an Image. Counted by looking at every `0 + skips`th (every 1, 2nd, 3rd, 4th, etc.) pixel. + * + * @param pixelsToSkip The number of pixels to skip while iterating through the image. Ex. supplying 1 will skip every other pixel, 0 will skip none. The greater the number the less accuracy the result will have. + */ + dominantColor(pixelsToSkip: number): ColorObject; + /** * Return the color of the pixel at the (left, top) coordinate. */