24 lines
617 B
MonkeyC
24 lines
617 B
MonkeyC
import Toybox.Graphics;
|
|
import Toybox.Lang;
|
|
import Toybox.WatchUi;
|
|
|
|
class SolidBackground extends IBackground {
|
|
|
|
var Color as ColorType;
|
|
|
|
typedef SolidBackgroundParams as {
|
|
:BackgroundParams as IBackground.BackgroundParams,
|
|
:Color as ColorType,
|
|
};
|
|
|
|
function initialize(options as SolidBackgroundParams) {
|
|
IBackground.initialize(getOrElse(options[:BackgroundParams], {}));
|
|
|
|
Color = getOrElse(options[:Color], Graphics.COLOR_BLACK);
|
|
}
|
|
|
|
function drawBackground(dc as Dc) as Void {
|
|
dc.setColor(Graphics.COLOR_TRANSPARENT, Color);
|
|
dc.clear();
|
|
}
|
|
} |