Fixed fonts and colors

pull/2211/head
jukioo 2022-10-24 13:26:20 +03:00 committed by GitHub
parent 5c077c490b
commit 87ea7335de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 8 deletions

View File

@ -4,6 +4,8 @@
// by Jukio Kallio // by Jukio Kallio
// www.jukiokallio.com // www.jukiokallio.com
require("FontHaxorNarrow7x17").add(Graphics);
// settings // settings
const breath = { const breath = {
theme: "default", theme: "default",
@ -15,9 +17,9 @@ const breath = {
keepcolor: g.theme.fg, keepcolor: g.theme.fg,
outcolor: g.theme.fg, outcolor: g.theme.fg,
font: "Vector", fontsize: 14, font: "HaxorNarrow7x17", fontsize: 1,
textcolor: g.theme.fg, textcolor: g.theme.fg,
texty: 16, texty: 18,
in: 4000, in: 4000,
keep: 7000, keep: 7000,
@ -61,7 +63,7 @@ function draw() {
g.reset(); g.reset();
// Clear the area where we want to draw the time // Clear the area where we want to draw the time
g.setColor(breath.bgcolor.r, breath.bgcolor.g, breath.bgcolor.b); g.setColor(breath.bgcolor);
g.fillRect(0, 0, breath.w, breath.h); g.fillRect(0, 0, breath.w, breath.h);
// calculate circle size // calculate circle size
@ -69,17 +71,17 @@ function draw() {
if (time < breath.in) { if (time < breath.in) {
// breath in // breath in
circle = time / breath.in; circle = time / breath.in;
g.setColor(breath.incolor.r, breath.incolor.g, breath.incolor.b); g.setColor(breath.incolor);
} else if (time < breath.in + breath.keep) { } else if (time < breath.in + breath.keep) {
// keep breath // keep breath
circle = 1; circle = 1;
g.setColor(breath.keepcolor.r, breath.keepcolor.g, breath.keepcolor.b); g.setColor(breath.keepcolor);
} else if (time < breath.in + breath.keep + breath.out) { } else if (time < breath.in + breath.keep + breath.out) {
// breath out // breath out
circle = ((breath.in + breath.keep + breath.out) - time) / breath.out; circle = ((breath.in + breath.keep + breath.out) - time) / breath.out;
g.setColor(breath.outcolor.r, breath.outcolor.g, breath.outcolor.b); g.setColor(breath.outcolor);
} }
@ -87,11 +89,11 @@ function draw() {
g.fillCircle(breath.x, breath.y, breath.size * circle); g.fillCircle(breath.x, breath.y, breath.size * circle);
// breath area // breath area
g.setColor(breath.textcolor.r, breath.textcolor.g, breath.textcolor.b); g.setColor(breath.textcolor);
g.drawCircle(breath.x, breath.y, breath.size); g.drawCircle(breath.x, breath.y, breath.size);
// draw text // draw text
g.setFontAlign(0,0).setFont(breath.font, breath.fontsize).setColor(breath.textcolor.r, breath.textcolor.g, breath.textcolor.b); g.setFontAlign(0,0).setFont(breath.font, breath.fontsize).setColor(breath.textcolor);
if (time < breath.in) { if (time < breath.in) {
// breath in // breath in