Skip to content

Commit 5b91d99

Browse files
committed
(#500) Introduce and export new query function pixelWithColor
1 parent 489fb61 commit 5b91d99

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

index.ts

+18-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ import { LineHelper } from "./lib/util/linehelper.class";
88
import { createWindowApi } from "./lib/window.function";
99
import providerRegistry from "./lib/provider/provider-registry.class";
1010
import { loadImageResource } from "./lib/imageResources.function";
11-
import { LineQuery, WindowQuery, WordQuery } from "./lib/query.class";
11+
import {
12+
ColorQuery,
13+
LineQuery,
14+
WindowQuery,
15+
WordQuery,
16+
} from "./lib/query.class";
17+
import { RGBA } from "./lib/rgba.class";
1218

1319
export {
1420
AssertClass,
@@ -100,6 +106,16 @@ const windowWithTitle = (title: string | RegExp): WindowQuery => {
100106
};
101107
};
102108

109+
const pixelWithColor = (color: RGBA): ColorQuery => {
110+
return {
111+
type: "color",
112+
id: `pixel-by-color-query-RGBA(${color.R},${color.G},${color.B},${color.A})`,
113+
by: {
114+
color,
115+
},
116+
};
117+
};
118+
103119
export { fetchFromUrl } from "./lib/imageResources.function";
104120

105121
export {
@@ -121,4 +137,5 @@ export {
121137
singleWord,
122138
textLine,
123139
windowWithTitle,
140+
pixelWithColor,
124141
};

0 commit comments

Comments
 (0)