Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminal themes use ANSI colors #24

Merged
merged 2 commits into from
Apr 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 2 additions & 100 deletions lib/termination.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -128,116 +128,18 @@ module.exports =
default: 'standard'
enum: [
'standard',
'inverse',
'linux',
'grass',
'homebrew',
'man-page',
'novel',
'ocean',
'pro',
'red',
'red-sands',
'silver-aerogel',
'solarized-dark',
'solid-colors',
'dracula',
'Christmas',
'github',
'one-dark'
'one-dark',
'one-light'
]
ansiColors:
type: 'object'
order: 4
properties:
normal:
type: 'object'
order: 1
properties:
black:
title: 'Black'
description: 'Black color used for terminal ANSI color set.'
type: 'color'
default: '#000000'
red:
title: 'Red'
description: 'Red color used for terminal ANSI color set.'
type: 'color'
default: '#CD0000'
green:
title: 'Green'
description: 'Green color used for terminal ANSI color set.'
type: 'color'
default: '#00CD00'
yellow:
title: 'Yellow'
description: 'Yellow color used for terminal ANSI color set.'
type: 'color'
default: '#CDCD00'
blue:
title: 'Blue'
description: 'Blue color used for terminal ANSI color set.'
type: 'color'
default: '#0000CD'
magenta:
title: 'Magenta'
description: 'Magenta color used for terminal ANSI color set.'
type: 'color'
default: '#CD00CD'
cyan:
title: 'Cyan'
description: 'Cyan color used for terminal ANSI color set.'
type: 'color'
default: '#00CDCD'
white:
title: 'White'
description: 'White color used for terminal ANSI color set.'
type: 'color'
default: '#E5E5E5'
zBright:
type: 'object'
order: 2
properties:
brightBlack:
title: 'Bright Black'
description: 'Bright black color used for terminal ANSI color set.'
type: 'color'
default: '#7F7F7F'
brightRed:
title: 'Bright Red'
description: 'Bright red color used for terminal ANSI color set.'
type: 'color'
default: '#FF0000'
brightGreen:
title: 'Bright Green'
description: 'Bright green color used for terminal ANSI color set.'
type: 'color'
default: '#00FF00'
brightYellow:
title: 'Bright Yellow'
description: 'Bright yellow color used for terminal ANSI color set.'
type: 'color'
default: '#FFFF00'
brightBlue:
title: 'Bright Blue'
description: 'Bright blue color used for terminal ANSI color set.'
type: 'color'
default: '#0000FF'
brightMagenta:
title: 'Bright Magenta'
description: 'Bright magenta color used for terminal ANSI color set.'
type: 'color'
default: '#FF00FF'
brightCyan:
title: 'Bright Cyan'
description: 'Bright cyan color used for terminal ANSI color set.'
type: 'color'
default: '#00FFFF'
brightWhite:
title: 'Bright White'
description: 'Bright white color used for terminal ANSI color set.'
type: 'color'
default: '#FFFFFF'
iconColors:
type: 'object'
order: 5
Expand Down
19 changes: 19 additions & 0 deletions lib/themes/dracula.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports =
normal:
black: '#000000'
red:'#FF5555'
green: '#50FA7B'
yellow: '#F1FA8C'
blue: '#BD93F9'
magenta: '#FF79C6'
cyan: '#8BE9FD'
white: '#BFBFBF'
bright:
black: '#666666'
red: '#FF5555'
green: '#50FA7B'
yellow: '#F1FA8C'
blue: '#BD93F9'
magenta: '#FF79C6'
cyan: '#8BE9FD'
white: '#E5E5E5'
19 changes: 19 additions & 0 deletions lib/themes/grass.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports =
normal:
black: '#000000'
red:'#990000'
green: '#00A600'
yellow: '#999900'
blue: '#0000B2'
magenta: '#B200B2'
cyan: '#00A6B2'
white: '#BFBFBF'
bright:
black: '#666666'
red: '#E50000'
green: '#00D900'
yellow: '#E5E500'
blue: '#0000FF'
magenta: '#E500E5'
cyan: '#00E5E5'
white: '#E5E5E5'
19 changes: 19 additions & 0 deletions lib/themes/homebrew.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports =
normal:
black: '#000000'
red:'#990000'
green: '#00A600'
yellow: '#999900'
blue: '#0000B2'
magenta: '#B200B2'
cyan: '#00A6B2'
white: '#BFBFBF'
bright:
black: '#666666'
red: '#E50000'
green: '#00D900'
yellow: '#E5E500'
blue: '#0000FF'
magenta: '#E500E5'
cyan: '#00E5E5'
white: '#E5E5E5
19 changes: 19 additions & 0 deletions lib/themes/ocean.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports =
normal:
black: '#000000'
red:'#990000'
green: '#00A600'
yellow: '#999900'
blue: '#0000B2'
magenta: '#B200B2'
cyan: '#00A6B2'
white: '#BFBFBF'
bright:
black: '#666666'
red: '#E50000'
green: '#00D900'
yellow: '#E5E500'
blue: '#0000FF'
magenta: '#E500E5'
cyan: '#00E5E5'
white: '#E5E5E5'
19 changes: 19 additions & 0 deletions lib/themes/one-dark.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports =
normal:
black: '#1E2127'
red:'#E06C75'
green: '#98C379'
yellow: '#D19A66'
blue: '#61AFEF'
magenta: '#C678DD'
cyan: '#56B6C2'
white: '#ABB2BF'
bright:
black: '#5C6370'
red: '#E06C75'
green: '#98C379'
yellow: '#D19A66'
blue: '#61AFEF'
magenta: '#C678DD'
cyan: '#56B6C2'
white: '#ffffff'
19 changes: 19 additions & 0 deletions lib/themes/one-light.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports =
normal:
black: '#000000'
red:'#DE3E35'
green: '#3F953A'
yellow: '#D2B67C'
blue: '#2F5AF3'
magenta: '#950095'
cyan: '#3F953A'
white: '#BBBBBB'
bright:
black: '#000000'
red: '#DE3E35'
green: '#3F953A'
yellow: '#D2B67C'
blue: '#2F5AF3'
magenta: '#A00095'
cyan: '#3F953A'
white: '#FFFFFF'
19 changes: 19 additions & 0 deletions lib/themes/pro.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports =
normal:
black: '#000000'
red:'#990000'
green: '#00A600'
yellow: '#999900'
blue: '#0000B2'
magenta: '#B200B2'
cyan: '#00A6B2'
white: '#BFBFBF'
bright:
black: '#666666'
red: '#E50000'
green: '#00D900'
yellow: '#E5E500'
blue: '#0000FF'
magenta: '#E500E5'
cyan: '#00E5E5'
white: '#E5E5E5'
19 changes: 19 additions & 0 deletions lib/themes/red-sands.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports =
normal:
black: '#000000'
red:'#990000'
green: '#00A600'
yellow: '#999900'
blue: '#0000B2'
magenta: '#B200B2'
cyan: '#00A6B2'
white: '#BFBFBF'
bright:
black: '#666666'
red: '#E50000'
green: '#00D900'
yellow: '#E5E500'
blue: '#0000FF'
magenta: '#E500E5'
cyan: '#00E5E5'
white: '#E5E5E5'
19 changes: 19 additions & 0 deletions lib/themes/silver-aerogel.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports =
normal:
black: '#000000'
red:'#990000'
green: '#00A600'
yellow: '#999900'
blue: '#0000B2'
magenta: '#B200B2'
cyan: '#00A6B2'
white: '#BFBFBF'
bright:
black: '#666666'
red: '#E50000'
green: '#00D900'
yellow: '#E5E500'
blue: '#0000FF'
magenta: '#E500E5'
cyan: '#00E5E5'
white: '#E5E5E5'
19 changes: 19 additions & 0 deletions lib/themes/solarized-dark.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports =
normal:
black: '#073642'
red:'#DC322F'
green: '#859900'
yellow: '#B58900'
blue: '#268BD2'
magenta: '#D33682'
cyan: '#2AA198'
white: '#EEE8D5'
bright:
black: '#002B36'
red: '#CB4B16'
green: '#586E75'
yellow: '#657B83'
blue: '#839496'
magenta: '#6C71C4'
cyan: '#93A1A1'
white: '#FDF6E3'
19 changes: 19 additions & 0 deletions lib/themes/standard.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports =
normal:
black: '#000000'
red:'#990000'
green: '#00A600'
yellow: '#999900'
blue: '#0000B2'
magenta: '#B200B2'
cyan: '#00A6B2'
white: '#BFBFBF'
bright:
black: '#666666'
red: '#E50000'
green: '#00D900'
yellow: '#E5E500'
blue: '#0000FF'
magenta: '#E500E5'
cyan: '#00E5E5'
white: '#E5E5E5'
34 changes: 18 additions & 16 deletions lib/view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ class TerminationView extends View
@xterm.addClass config.style.theme
@xterm.addClass 'cursor-blink' if config.toggles.cursorBlink

ansiColors = require('./themes/' + config.style.theme)

editorFont = atom.config.get('editor.fontFamily')
defaultFont = "Menlo, Consolas, 'DejaVu Sans Mono', monospace"
overrideFont = config.style.fontFamily
Expand Down Expand Up @@ -299,25 +301,25 @@ class TerminationView extends View

# first 8 colors i.e. 'dark' colors
@terminal.colors[0..7] = [
config.ansiColors.normal.black.toHexString()
config.ansiColors.normal.red.toHexString()
config.ansiColors.normal.green.toHexString()
config.ansiColors.normal.yellow.toHexString()
config.ansiColors.normal.blue.toHexString()
config.ansiColors.normal.magenta.toHexString()
config.ansiColors.normal.cyan.toHexString()
config.ansiColors.normal.white.toHexString()
ansiColors.normal.black
ansiColors.normal.red
ansiColors.normal.green
ansiColors.normal.yellow
ansiColors.normal.blue
ansiColors.normal.magenta
ansiColors.normal.cyan
ansiColors.normal.white
]
# 'bright' colors
@terminal.colors[8..15] = [
config.ansiColors.zBright.brightBlack.toHexString()
config.ansiColors.zBright.brightRed.toHexString()
config.ansiColors.zBright.brightGreen.toHexString()
config.ansiColors.zBright.brightYellow.toHexString()
config.ansiColors.zBright.brightBlue.toHexString()
config.ansiColors.zBright.brightMagenta.toHexString()
config.ansiColors.zBright.brightCyan.toHexString()
config.ansiColors.zBright.brightWhite.toHexString()
ansiColors.bright.black
ansiColors.bright.red
ansiColors.bright.green
ansiColors.bright.yellow
ansiColors.bright.blue
ansiColors.bright.magenta
ansiColors.bright.cyan
ansiColors.bright.white
]

attachWindowEvents: ->
Expand Down
Loading