From 8ff1162897acc9a393f41edf9faf5593d6c66995 Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Mon, 25 Aug 2025 12:33:03 +0200 Subject: Replace JS with rust --- doc/README.md | 261 ---------------------------------------------------------- 1 file changed, 261 deletions(-) delete mode 100644 doc/README.md (limited to 'doc') diff --git a/doc/README.md b/doc/README.md deleted file mode 100644 index c1054cd..0000000 --- a/doc/README.md +++ /dev/null @@ -1,261 +0,0 @@ -## Classes - -
-
TomatoSauceEventEmitter
-
-
- -## Members - -
-
Util : Object
-

Module containing utility functions

-
-
- -## Functions - -
-
256ColorsRenderer()
-

Returns a 256 color, see https://en.wikipedia.org/wiki/ANSI_escape_code#Colors -for more info.

-
-
ANSIRenderer()
-

Returns a basic ansi color, see https://en.wikipedia.org/wiki/ANSI_escape_code#Colors -for more info.

-
-
FakeColorRenderer()
-

Returns a malformed 24-bit ansi color

-
-
TrueColorRenderer()
-

Returns an ANSI code for 24-bit True Color, see -https://en.wikipedia.org/wiki/ANSI_escape_code#Colors and look for -24-bit colors for more info. Only looks good in supported terminals, -otherwise looks like FakeColor

-
-
CircleScreen()
-

Draws concentric circles. Each ring has its own color.

-
-
GradientsScreen()
-

Draws moving gradient boxes

-
-
MirrorsScreen()
-

Draws small moving gradient boxes and repeats them.

-
-
RandomScreen()
-

Draws random colors

-
-
SprinklesScreen()
-

Draws random sprinkles in the screen each frame. Same color per -frame.

-
-
- -## Interfaces - -
-
IScreenString
-

A function that represents a screen, it is called frequently and should -return a string consisting of commands to run.

-
-
IRendererString
-

A function that represents a renderer, it should take in a color in RGB and -return a string with the appropriate code to colorize the terminal.

-
-
- - - -## IScreen ⇒ String -A function that represents a screen, it is called frequently and should -return a string consisting of commands to run. - -**Kind**: global interface -**Returns**: String - The commands used to render the screen elements - -| Param | Type | Description | -| --- | --- | --- | -| modulation | Number | A number between 0 and 255 representing the current step of the modulation | -| width | Number | The width of the screen | -| height | Number | The height of the screen | -| renderer | [IRenderer](#IRenderer) | The renderer used to colorize the scfeen | - - - -## IRenderer ⇒ String -A function that represents a renderer, it should take in a color in RGB and -return a string with the appropriate code to colorize the terminal. - -**Kind**: global interface -**Returns**: String - The commands used to colorize the terminal - -| Param | Type | Description | -| --- | --- | --- | -| red | Number | The red component of the color between 0 and 255 | -| green | Number | The green component of the color between 0 and 255 | -| blue | Number | The green component of the color between 0 and 255 | - - - -## TomatoSauce ⇐ EventEmitter -**Kind**: global class -**Extends**: EventEmitter -**Properties** - -| Name | Type | Default | Description | -| --- | --- | --- | --- | -| screens | [Array.<IScreen>](#IScreen) | | an array of screens available to serve | -| renderers | [Array.<IRenderer>](#IRenderer) | | an array of renderers available to colorize | -| [port] | Number | 9999 | the port to listen on | -| [frequency] | Number | 333 | how often to update the screen | -| [modulation] | Number | 5 | number between 0-255 depicting current modulation step | - - -* [TomatoSauce](#TomatoSauce) ⇐ EventEmitter - * [new TomatoSauce(config)](#new_TomatoSauce_new) - * [.run()](#TomatoSauce+run) - - - -### new TomatoSauce(config) -The main application for tomato sauce. Listens for connections and serves -random combinations of screens and renderers - -The main entry point is the `#run()` function. - -It emits a listening event that contains the server information on -the `server` key inside the `data` property of the event. - -It also emits an error event that contains the error information on -the `error` key inside the `data` property of the event. - - -| Param | Type | Description | -| --- | --- | --- | -| config | object | the configuration object used to extend the properties. | - - - -### tomatoSauce.run() -Main entry point, initializes the server and binds events for connections - -**Kind**: instance method of [TomatoSauce](#TomatoSauce) - - -## Util : Object -Module containing utility functions - -**Kind**: global variable - -* [Util](#Util) : Object - * [.parse16BitBuffer(buffer)](#Util.parse16BitBuffer) ⇒ Number - * [.pickRandom(array)](#Util.pickRandom) ⇒ Any - * [.loadFiles(path)](#Util.loadFiles) ⇒ Array - - - -### Util.parse16BitBuffer(buffer) ⇒ Number -Parses a 16 bit number buffer - -**Kind**: static method of [Util](#Util) -**Returns**: Number - the parsed value - -| Param | Type | Description | -| --- | --- | --- | -| buffer | Array.<String> | the buffer to parse | - - - -### Util.pickRandom(array) ⇒ Any -Picks a random element from an array - -**Kind**: static method of [Util](#Util) -**Returns**: Any - the picked element - -| Param | Type | Description | -| --- | --- | --- | -| array | Array | the array to use | - - - -### Util.loadFiles(path) ⇒ Array -For a gi ven path, requires all of the files and returns an array -with the results. If the directory contains any non-requireable -files, it will fail. - -**Kind**: static method of [Util](#Util) -**Returns**: Array - the array of all the loaded modules - -| Param | Type | Description | -| --- | --- | --- | -| path | String | the path where the files are located | - - - -## 256ColorsRenderer() -Returns a 256 color, see https://en.wikipedia.org/wiki/ANSI_escape_code#Colors -for more info. - -**Kind**: global function -**Implements**: [IRenderer](#IRenderer) - - -## ANSIRenderer() -Returns a basic ansi color, see https://en.wikipedia.org/wiki/ANSI_escape_code#Colors -for more info. - -**Kind**: global function -**Implements**: [IRenderer](#IRenderer) - - -## FakeColorRenderer() -Returns a malformed 24-bit ansi color - -**Kind**: global function -**Implements**: [IRenderer](#IRenderer) - - -## TrueColorRenderer() -Returns an ANSI code for 24-bit True Color, see -https://en.wikipedia.org/wiki/ANSI_escape_code#Colors and look for -24-bit colors for more info. Only looks good in supported terminals, -otherwise looks like FakeColor - -**Kind**: global function -**Implements**: [IRenderer](#IRenderer) - - -## CircleScreen() -Draws concentric circles. Each ring has its own color. - -**Kind**: global function -**Implements**: [IScreen](#IScreen) - - -## GradientsScreen() -Draws moving gradient boxes - -**Kind**: global function -**Implements**: [IScreen](#IScreen) - - -## MirrorsScreen() -Draws small moving gradient boxes and repeats them. - -**Kind**: global function -**Implements**: [IScreen](#IScreen) - - -## RandomScreen() -Draws random colors - -**Kind**: global function -**Implements**: [IScreen](#IScreen) - - -## SprinklesScreen() -Draws random sprinkles in the screen each frame. Same color per -frame. - -**Kind**: global function -**Implements**: [IScreen](#IScreen) -- cgit