Skip to content

ZokugunKS/lang.color.xterm

Repository files navigation

kaoscript License NPM Version Dependency Status Build Status CircleCI Coverage Status

Provides xterm/term parser and formatter to Color class.

Getting Started

In Node.js

With node previously installed:

npm install @zokugun/lang.color.xterm

Use it with JavaScript:

require('kaoscript/register');

const { Color, Space } = require('@zokugun/lang.color.xterm')();

const c = new Color('x50');

Use it with kaoscript:

import '@zokugun/lang.color.xterm'

const c = new Color('x50')

Usage

import '@zokugun/lang.color.xterm'

const c = new Color('#abc')

expect(c.term()).to.equal(7)
expect(c.xterm()).to.equal(146)
expect(c.format('term')).to.equal('x007')
expect(c.format('xterm')).to.equal('x146')

The Colors

Color xterm hex Color xterm hex Color xterm hex
x000#000000 x001#800000 x002#008000
x003#808000 x004#000080 x005#800080
x006#008080 x007#c0c0c0 x008#808080
x009#ff0000 x010#00ff00 x011#ffff00
x012#0000ff x013#ff00ff x014#00ffff
x015#ffffff x016#000000 x017#00005f
x018#000087 x019#0000af x020#0000d7
x021#0000ff x022#005f00 x023#005f5f
x024#005f87 x025#005faf x026#005fd7
x027#005fff x028#008700 x029#00875f
x030#008787 x031#0087af x032#0087d7
x033#0087ff x034#00af00 x035#00af5f
x036#00af87 x037#00afaf x038#00afd7
x039#00afff x040#00d700 x041#00d75f
x042#00d787 x043#00d7af x044#00d7d7
x045#00d7ff x046#00ff00 x047#00ff5f
x048#00ff87 x049#00ffaf x050#00ffd7
x051#00ffff x052#5f0000 x053#5f005f
x054#5f0087 x055#5f00af x056#5f00d7
x057#5f00ff x058#5f5f00 x059#5f5f5f
x060#5f5f87 x061#5f5faf x062#5f5fd7
x063#5f5fff x064#5f8700 x065#5f875f
x066#5f8787 x067#5f87af x068#5f87d7
x069#5f87ff x070#5faf00 x071#5faf5f
x072#5faf87 x073#5fafaf x074#5fafd7
x075#5fafff x076#5fd700 x077#5fd75f
x078#5fd787 x079#5fd7af x080#5fd7d7
x081#5fd7ff x082#5fff00 x083#5fff5f
x084#5fff87 x085#5fffaf x086#5fffd7
x087#5fffff x088#870000 x089#87005f
x090#870087 x091#8700af x092#8700d7
x093#8700ff x094#875f00 x095#875f5f
x096#875f87 x097#875faf x098#875fd7
x099#875fff x100#878700 x101#87875f
x102#878787 x103#8787af x104#8787d7
x105#8787ff x106#87af00 x107#87af5f
x108#87af87 x109#87afaf x110#87afd7
x111#87afff x112#87d700 x113#87d75f
x114#87d787 x115#87d7af x116#87d7d7
x117#87d7ff x118#87ff00 x119#87ff5f
x120#87ff87 x121#87ffaf x122#87ffd7
x123#87ffff x124#af0000 x125#af005f
x126#af0087 x127#af00af x128#af00d7
x129#af00ff x130#af5f00 x131#af5f5f
x132#af5f87 x133#af5faf x134#af5fd7
x135#af5fff x136#af8700 x137#af875f
x138#af8787 x139#af87af x140#af87d7
x141#af87ff x142#afaf00 x143#afaf5f
x144#afaf87 x145#afafaf x146#afafd7
x147#afafff x148#afd700 x149#afd75f
x150#afd787 x151#afd7af x152#afd7d7
x153#afd7ff x154#afff00 x155#afff5f
x156#afff87 x157#afffaf x158#afffd7
x159#afffff x160#d70000 x161#d7005f
x162#d70087 x163#d700af x164#d700d7
x165#d700ff x166#d75f00 x167#d75f5f
x168#d75f87 x169#d75faf x170#d75fd7
x171#d75fff x172#d78700 x173#d7875f
x174#d78787 x175#d787af x176#d787d7
x177#d787ff x178#d7af00 x179#d7af5f
x180#d7af87 x181#d7afaf x182#d7afd7
x183#d7afff x184#d7d700 x185#d7d75f
x186#d7d787 x187#d7d7af x188#d7d7d7
x189#d7d7ff x190#d7ff00 x191#d7ff5f
x192#d7ff87 x193#d7ffaf x194#d7ffd7
x195#d7ffff x196#ff0000 x197#ff005f
x198#ff0087 x199#ff00af x200#ff00d7
x201#ff00ff x202#ff5f00 x203#ff5f5f
x204#ff5f87 x205#ff5faf x206#ff5fd7
x207#ff5fff x208#ff8700 x209#ff875f
x210#ff8787 x211#ff87af x212#ff87d7
x213#ff87ff x214#ffaf00 x215#ffaf5f
x216#ffaf87 x217#ffafaf x218#ffafd7
x219#ffafff x220#ffd700 x221#ffd75f
x222#ffd787 x223#ffd7af x224#ffd7d7
x225#ffd7ff x226#ffff00 x227#ffff5f
x228#ffff87 x229#ffffaf x230#ffffd7
x231#ffffff x232#080808 x233#121212
x234#1c1c1c x235#262626 x236#303030
x237#3a3a3a x238#444444 x239#4e4e4e
x240#585858 x241#626262 x242#6c6c6c
x243#767676 x244#808080 x245#8a8a8a
x246#949494 x247#9e9e9e x248#a8a8a8
x249#b2b2b2 x250#bcbcbc x251#c6c6c6
x252#d0d0d0 x253#dadada x254#e4e4e4
x255#eeeeee

License

MIT © Baptiste Augrain