summaryrefslogtreecommitdiff
path: root/lib/screens/circle.js
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2025-08-25 12:33:03 +0200
committerRuben Beltran del Rio <git@r.bdr.sh>2025-08-25 12:33:03 +0200
commit8ff1162897acc9a393f41edf9faf5593d6c66995 (patch)
treeb93e52d0b0c36a84b29fe0e5dde3d7401ec130eb /lib/screens/circle.js
parent3ec8e14833b55d6bff4cf5702f90e1bb9a1b1e40 (diff)
Replace JS with rust
Diffstat (limited to 'lib/screens/circle.js')
-rw-r--r--lib/screens/circle.js36
1 files changed, 0 insertions, 36 deletions
diff --git a/lib/screens/circle.js b/lib/screens/circle.js
deleted file mode 100644
index d09cb07..0000000
--- a/lib/screens/circle.js
+++ /dev/null
@@ -1,36 +0,0 @@
-'use strict';
-
-/**
- * Draws concentric circles. Each ring has its own color.
- *
- * @function CircleScreen
- * @implements IScreen
- */
-module.exports = function (modulation, width, height, renderer) {
-
- let response = '';
-
- const circles = width > height ? height : width;
-
- for (let i = 0; i < circles; ++i) {
- const centerX = Math.round(width / 2) + 1;
- const centerY = Math.round(height / 2) + 1;
-
- const red = Math.floor(Math.random() * 255);
- const blue = Math.floor(Math.random() * 255);
- const green = Math.floor(Math.random() * 255);
-
- for (let j = 0; j < 180; ++j) {
- const angle = 2 * j * (Math.PI / 180);
- const x = Math.round(centerX + Math.sin(angle) * i);
- const y = Math.round(centerY + Math.cos(angle) * i);
-
- if (x <= width && x > 0 && y <= height && y > 0) {
- const position = `\x1B[${y};${x}H`; // Move cursor to y,x (CSI y;x H)
- response += `${position}${renderer(red, blue, green)} `;
- }
- }
- }
-
- return response;
-};