lazy-widgets
Version:
Typescript retained mode GUI for the HTML canvas API
23 lines • 775 B
JavaScript
import { Theme } from './Theme.js';
/**
* A theme which always gives out a random canvas fill colour. Used for
* debugging when painting occurs. Has no properties but always has a fallback
* theme.
*
* @category Theme
*/
export class DebugTheme extends Theme {
/**
* @param fallback - The actual theme to use. Canvas fill color will be ignored as it is randomly generated. If none supplied, then the default theme found in {@link Theme."constructor"} is used
*/
constructor(fallback = new Theme()) {
super(undefined, fallback);
}
get canvasFill() {
return '#' + Math.floor(Math.random() * 0xffffff).toString(16);
}
set canvasFill(value) {
super.canvasFill = value;
}
}
//# sourceMappingURL=DebugTheme.js.map