Fix IColorable.getColorOption (#551)

* Fix IColorable.getColorOption

* nit
This commit is contained in:
Chenlei Hu
2025-02-19 14:57:29 -05:00
committed by GitHub
parent 8b1b8d2a76
commit 7bab620986
4 changed files with 19 additions and 13 deletions

View File

@@ -83,6 +83,13 @@ export interface IColorable {
getColorOption(): ColorOption | null
}
/**
* Checks if an object is an instance of {@link IColorable}.
*/
export const isColorable = (obj: unknown): obj is IColorable => {
return typeof obj === "object" && obj !== null && "setColorOption" in obj && "getColorOption" in obj
}
/**
* An object that can be pinned.
*