Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

@mapgen/renderer-terminal

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mapgen/renderer-terminal

Terminal renderer for pixel-art map generator mapgen

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
4
100%
Maintainers
1
Weekly downloads
 
Created
Source

@mapgen/renderer-terminal

Render created map to terminal.

Usage

As far terminal has only 256 colors a basic color mapping is performed via color difference calculation:

  • Euclidean (default)
import { mapgen } from '@mapgen/mapgen';
import { TerminalRenderer } from '@mapgen/renderer-terminal';
import { terminal } from 'terminal-kit';

const renderer = new TerminalRenderer(terminal);

mapgen(renderer);

Rendered to console

  • CIEDE2000
import { mapgen } from '@mapgen/mapgen';
import { TerminalRenderer, CIEDE2000ColorResolver } from '@mapgen/renderer-terminal';
import { terminal } from 'terminal-kit';

const renderer = new TerminalRenderer(terminal, new CIEDE2000ColorResolver());

mapgen(renderer);

Rendered to console

Keywords

terminal

FAQs

Package last updated on 26 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts