prototype 1

This commit is contained in:
2026-01-06 00:21:02 -08:00
parent 1f8fd99d25
commit 6f59fa26bd
6 changed files with 707 additions and 40 deletions

13
main.py
View File

@@ -7,24 +7,11 @@ from modules.clocks import crt
app = flask.Flask(__name__)
clock = crt.CRTClock(R=((1, 0, 0), (0, 1, 0), (0, 0, 1)))
@app.route("/")
def index():
return render_template("index.html")
@app.route("/color")
def get_color():
global clock
now = datetime.datetime.now()
color = clock.transform(now)
r = int(color[0] * 255)
g = int(color[1] * 255)
b = int(color[2] * 255)
return flask.jsonify({"color": f"rgb({r}, {g}, {b})"})
if __name__ == "__main__":
app.run(debug=True)