Code Monkey home page Code Monkey logo

blessed-themes's Introduction

๐ŸŒˆ blessed-themes ๐Ÿญ

Themes for TUI (terminal user inteface) apps created using blessed.

Install

npm install @blessed/themes

Using yarn

yarn add @blessed/themes

Using pnpm

pnpm add @blessed/themes

Usage

Create a styles.js file like this:

'use strict';

module.exports = function (colors) {

  // Destructure the colors for easy access
  const {
    primary: { background, foreground },
    normal: { red, green, blue, yellow, magenta, cyan },
  } = colors;

  return {
    colors, // this is for inline usage of theme colors for text and labels
    program: {
      bg: background,
      fg: foreground,
    },
    header: {
      border: {
        type: 'line',
        fg: foreground,
        bg: background,
      },
      style: {
        fg: red,
        bg: background,
      },
    },
  };
};

Using the theme

// Import the theme colors
const colors = require('blessed-themes/theme/Gruvbox-Dark');
// Pass the theme colors to styles
const theme = require('./styles')(colors.colors);

// Initialize the program, to change the default color of the terminal screen
const program = blessed.program();

// Use the bg and fg colors from the theme for the program
program.bg(theme.program.bg);
program.fg(theme.program.fg);

// Get the styles of a widget from the theme
const { style, border } = theme.header;

const header = blessed.box({
  parent: screen,
  content: 'My Awesome CLI',
  top: 0,
  left: 0,
  width: '30%',
  height: '10%',
  border,
  style,
});

Themes

You can find the list of theme names from themes folder.

Dracula

Dracula

3024.dark

3024.dark

3024.light

3024.light

Argonaut

Argonaut

Afterglow

Afterglow

Zenburn

Zenburn

Gruvbox-Dark

Gruvbox-Dark

Gruvbox-Light

Gruvbox-Light

Molokai

Molokai

Nord

Nord

Tango

Tango

Wombat

Wombat

Tomorrow-Night

Tomorrow-Night

Solarized-Dark

Solarized-Dark

Solarized-Light

Solarized-Light

Light Themes

  • Gruvbox-Light
  • Solarized-Light

blessed-themes's People

Contributors

rajasegar avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.