initial commit
This commit is contained in:
24
source/Background/SolidBackground.mc
Normal file
24
source/Background/SolidBackground.mc
Normal file
@ -0,0 +1,24 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user