color-tabs

Adds colors to tabs..

paulpflug

46,698

44

0.1.8

MIT

GitHub

This package provides the following services:

color-tabs package

Adds colors to tabs..

seti -- backgroundStyle: solid, markerStyle: none, borderStyle: none

color-tabs -- backgroundStyle: gradient, markerStyle: none, borderStyle: none

atom -- backgroundStyle: none, markerStyle: none, borderStyle: bottom

darkone -- backgroundStyle: none, markerStyle: corner, borderStyle: none

isotope -- backgroundStyle: none, markerStyle: corner, borderStyle: bottom

Not all styles are working with all themes!

Usage

ctrl+alt+a to add a random color to active tab

ctrl+alt+x to remove the color from active tab

Other cool packages

Where to set style

settings

Services

This package also provides two services

package.json

{
  "otherStuff": "otherData",
  "consumedServices": {
    "color-change-cb": {
      "versions": {
        "^0.0.1": "consumeColorChangeCb"
      }
    },
    "change-color": {
      "versions": {
        "^0.0.1": "consumeChangeColor"
      }
    }
  }
}

your package:

  #in main module
  consumeChangeColor: (changeColor) =>
    @changeColor = changeColor
  consumeColorChangeCb: (colorChangeCb) =>
    @colorChangeCb = colorChangeCb

  #Wherever you want to use it
    @changeColor path, newColor # changes the color of a tab for a specific file path
    @changeColor path, false # removes the color
    @changeColor path, newColor, false # prevents saving, colors will not be persistent
    @changeColor path, newColor, false, true # will show a warning if path is undefined

    @cbHandler = @colorChangeCb (path, newColor) ->
      #is called after the color of a tab got changed
      #newColor is false if it got uncolored

  #cleanup cb
  deactivate: ->
    @cbHandler?.dispose?()

Developing

Run npm install in the package directory.

Open it in atom in dev mode.

For debugging set the debug field in package settings to the needed debug level.

Should autoreload the package on changes in lib and styles folders