Skip to content

Commit d39a8d6

Browse files
Update and rename docs/monochrome.md to docs/reference/images/monochrome.md
1 parent 87355ef commit d39a8d6

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

docs/monochrome.md

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## isMono
2+
a single color (hue) used in an image or display, where all pixels are variations of that hue. If the image is black and white, it is true. Otherwise, it is false.
3+
4+
## Returns
5+
a boolean which returns true if the image is black and white. The boolean expression is false if these 2 colors do **not** exist.
6+
7+
## Example
8+
Create a custom image detecting if the image has black and white, it logs into the console's serial output. Otherwise it throws an error.
9+
``` ts
10+
const customImage = image.create(160, 120);
11+
if (customImage.isMono) {
12+
console.log("Your Image Is Valid")
13+
} else {
14+
throw "Error: This Image is Invalid"
15+
}
16+
```

0 commit comments

Comments
 (0)