Sublime Forum

Sublime Text 3 light color scheme/theme in Colab style

#1

I spent a lot of time trying to find something similar to Colab color scheme. There are hundreds of dark themes but only a few of them are white. And none of them looks as clear as the default Colab color scheme:

Where can I find similar color scheme?

0 Likes

#2

If eventually you can’t find one, I would recommend creating your own from the one you most like. Maintaining a color scheme is not hard (actually it’s straightforward) in my opinion. It’s just repeatedly doing find target scope (ctrl+shift+p)define style for that scope in the color scheme

If I were you, I may modify https://packagecontrol.io/packages/Github%20Color%20Theme
image


import numpy as np

ys = 200 + np.random.randn(100)
x = [x for x in range(len(ys))]

plt.plot(x, yx, '-')
plt.fill_between(x, ys, 195, where=(yx > 195), facecolor='g', alpha=0.6)
0 Likes

#3

Hmm not quite the same, (It has an off-white, cream colour background) but you could check out Pechi

https://packagecontrol.io/packages/Grun%20Colour%20Scheme

Otherwise, if nothing fits your needs make one yourself and add it to package control! :slight_smile:

0 Likes

#4

Thanks! I’m trying to edit this thing.
Do you know the meaning of

<string>storage.type</string>

Is there any documentation for this?

0 Likes

#5

Is there any documentation for this?

https://www.sublimetext.com/docs/scope_naming.html

0 Likes

#6

You might want to look into :- https://www.sublimetext.com/docs/3/color_schemes.html for the modern .sublime-color-scheme format rather than the old .tmTheme format.

0 Likes

#7

I took a Github scheme and almost did it.


But there are a few problems. For some reason I can’t set the following colors:

"numbers" to green #10895A
"in" to blue #2C00FE
"range", "len" to yellow #786027
"strings" to red #A11919

Any help would be greatly appreciated.

0 Likes

#8

Take numbers as an example,

  1. Open your .py file
  2. Put your cursor on a number
  3. Press ctrl+alt+shift+p to show the scope of the cursor position (i.e., a number)
  4. Assign or change the styling rule in your color scheme for that scope
0 Likes

#9

numbers color is #0086B3. It exists in 6 places in the theme:

      <dict>
          <key>name</key>
          <string>Operators</string>
          <key>scope</key>
          <string>constant.language</string>
          <key>settings</key>
          <dict>
              <key>fontStyle</key>
              <string></string>
              <key>foreground</key>
              <string>#0086B3</string>
          </dict>
      </dict>

      <dict>
          <key>name</key>
          <string>Functions</string>
          <key>scope</key>
          <string>support.function</string>
          <key>settings</key>
          <dict>
              <key>fontStyle</key>
              <string></string>
              <key>foreground</key>
              <string>#0086B3</string>
          </dict>
      </dict>

      <dict>
          <key>name</key>
          <string>Classes</string>
          <key>scope</key>
          <string>support.class</string>
          <key>settings</key>
          <dict>
              <key>fontStyle</key>
              <string></string>
              <key>foreground</key>
              <string>#0086b3</string>
          </dict>
      </dict>

      <dict>
          <key>name</key>
          <string>Numbers</string>
          <key>scope</key>
          <string>constant.numeric, constant</string>
          <key>settings</key>
          <dict>
              <key>fontStyle</key>
              <string></string>
              <key>foreground</key>
              <string>#0086b3</string>
          </dict>
      </dict>

      <dict>
          <key>scope</key>
          <string>support.type.property-name, support.constant.property-value</string>
          <key>settings</key>
          <dict>
              <key>fontStyle</key>
              <string></string>
              <key>foreground</key>
              <string>#0086b3</string>
          </dict>
      </dict>

      <dict>
          <key>scope</key>
          <string>keyword.other.special-method.ruby.gem</string>
          <key>settings</key>
          <dict>
              <key>foreground</key>
              <string>#0086B3</string>
              <key>fontStyle</key>
              <string></string>
          </dict>
      </dict>

ctrl+alt+shift+p returns:

source.python
constant.numeric.float.python

and

source.python
meta.mapping.value.python
constant.numeric.integer.decimal.python

I’m not sure that I understand what exactly I should change. When I change the color inside <string>Numbers</string> nothing happens.

0 Likes

#10

Sounds weird to me. I think you are changing the right one.
https://packagecontrol.io/packages/ScopeHunter should give you more information about why it’s still that color.

You can use ScopeHunter’s command to replace the built-in one since ScopeHunter’s is superior.

    { "keys": ["ctrl+alt+shift+p"], "command": "get_selection_scope" },
0 Likes

#11

ScopeHunter shows the same info.

If anybody wants to try my color scheme is here.

0 Likes

#12

ScopeHunter should say which rule is applied to this scope.
Did you really change the color for Numbers? It remains the same in your provided file.

0 Likes

#13

image

Colab.sublime-color-scheme

{
    "name": "Colab",
    "author": "Unknown",
    "variables":
    {
        "black": "#000000",
        "black2": "#003300",
        "blue": "#183691",
        "blue2": "#b0d4ff",
        "blue3": "#0086b3",
        "blue4": "#445588",
        "green": "#63a35c",
        "green2": "#009926",
        "grey": "#969896",
        "grey2": "#333333",
        "orange": "#786027",
        "orange2": "#f2c6ab",
        "pink": "#990073",
        "purple": "#b000db",
        "purple2": "#2c00fe",
        "purple3": "#795da3",
        "purple4": "#100080",
        "red": "#f93232",
        "red2": "#770000",
        "white": "#ffdddd",
        "white2": "#fafafa",
        "white3": "#f7f7f7",
        "white4": "#ececec",
        "white5": "#e0e0e0",
        "white6": "#ddffdd",
        "yellow": "#75715e"
    },
    "globals":
    {
        "foreground": "var(black)",
        "background": "var(white3)",
        "caret": "var(black)",
        "invisibles": "var(white5)",
        "line_highlight": "var(white2)",
        "selection": "var(blue2)",
        "selection_border": "var(blue2)",
        "inactive_selection": "var(white3)",
        "find_highlight_foreground": "var(black)",
        "find_highlight": "var(orange2)"
    },
    "rules":
    [
        {
            "name": "Comments",
            "scope": "comment",
            "foreground": "var(grey)"
        },
        {
            "name": "Operators",
            "scope": "keyword.operator, support.constant",
            "foreground": "var(black)"
        },
        {
            "name": "Operators",
            "scope": "constant.language",
            "foreground": "var(blue3)"
        },
        {
            "name": "Keywords",
            "scope": "keyword, storage",
            "foreground": "var(purple)"
        },
        {
            "name": "Types",
            "scope": "storage.type",
            "foreground": "var(purple2)"
        },
        {
            "name": "Types",
            "scope": "support.type",
            "foreground": "var(black)"
        },
        {
            "scope": "variable",
            "foreground": "var(black)"
        },
        {
            "scope": "variable.language",
            "foreground": "var(purple4)"
        },
        {
            "scope": "variable.parameter.function",
            "foreground": "var(grey2)"
        },
        {
            "name": "Functions",
            "scope": "entity.name.function, entity",
            "foreground": "var(orange)"
        },
        {
            "name": "Functions",
            "scope": "support.function",
            "foreground": "var(blue3)"
        },
        {
            "name": "Classes",
            "scope": "entity.name.type, entity.other.inherited-class",
            "foreground": "var(black)"
        },
        {
            "name": "Classes",
            "scope": "support.class",
            "foreground": "var(blue3)"
        },
        {
            "name": "Exceptions",
            "scope": "entity.name.exception",
            "foreground": "var(red)"
        },
        {
            "name": "Sections",
            "scope": "entity.name.section"
        },
        {
            "name": "Numbers",
            "scope": "constant.numeric, constant",
            "foreground": "var(green2)"
        },
        {
            "name": "Strings",
            "scope": "constant.character, string, string punctuation",
            "foreground": "var(blue)"
        },
        {
            "name": "Strings: Regular Expressions",
            "scope": "string.regexp, string.regexp constant.character, string.regexp punctuation",
            "foreground": "var(green2)"
        },
        {
            "name": "Strings: Symbols",
            "scope": "constant.other.symbol",
            "foreground": "var(pink)"
        },
        {
            "name": "Embedded Source",
            "scope": "string source, text source",
            "foreground": "var(grey2)"
        },
        {
            "scope": "variable.other.property",
            "foreground": "var(grey2)"
        },
        {
            "scope": "entity.name",
            "foreground": "var(grey2)"
        },
        {
            "scope": "invalid",
            "foreground": "var(black)"
        },
        {
            "name": "HTML: Tags",
            "scope": "entity.name.tag",
            "foreground": "var(green)"
        },
        {
            "name": "HTML: Tags Punctuation",
            "scope": "punctuation.definition.tag",
            "foreground": "var(grey2)"
        },
        {
            "name": "HTML: Attribute Punctuation",
            "scope": "meta.tag string punctuation",
            "foreground": "var(blue)"
        },
        {
            "name": "HTML: Entities",
            "scope": "constant.character.entity",
            "foreground": "var(black)"
        },
        {
            "name": "HTML: Attribute Names",
            "scope": "entity.other.attribute-name",
            "foreground": "var(purple3)"
        },
        {
            "name": "HTML: Attribute Values",
            "scope": "meta.tag string.quoted, meta.tag string.quoted constant.character.entity",
            "foreground": "var(blue)"
        },
        {
            "scope": "meta.selector, meta.selector entity, meta.selector entity punctuation, entity.name.tag.css, entity.other.attribute-name.class, keyword.control.html.sass",
            "foreground": "var(green)"
        },
        {
            "scope": "entity.other.attribute-name.class, constant.other.unit",
            "foreground": "var(purple3)"
        },
        {
            "scope": "support.type.property-name, support.constant.property-value",
            "foreground": "var(blue3)"
        },
        {
            "scope": "keyword.other.special-method.ruby.gem",
            "foreground": "var(blue3)"
        },
        {
            "scope": "variable.other.block.ruby",
            "foreground": "var(black)"
        },
        {
            "scope": "support.function.prelude, variable.other.generic-type.haskell",
            "foreground": "var(black)"
        },
        {
            "scope": "constant.other.haskell, support.constant.haskell",
            "foreground": "var(blue4)"
        },
        {
            "name": "diff.header",
            "scope": "meta.diff, meta.diff.header",
            "foreground": "var(yellow)"
        },
        {
            "name": "diff.deleted",
            "scope": "markup.deleted",
            "foreground": "var(red2)",
            "background": "var(white)"
        },
        {
            "name": "diff.inserted",
            "scope": "markup.inserted",
            "foreground": "var(black2)",
            "background": "var(white6)"
        },
        {
            "name": "diff.changed",
            "scope": "markup.changed",
            "foreground": "var(white4)"
        }
    ]
}
0 Likes

#14

By the way, you can convert an old .tmTheme file to a new .sublime-color-scheme one from the command palette with Convert Color Scheme (or something similar) while you are editing a .tmTheme file.

0 Likes

#15

Yes. You can try to replace 0086B3, for example to FFFF00, and it will still be blue, not yellow. I replaced everything that changes the color and kept unchanged everything that does not affect anything.

0 Likes

#16

What’s the output of view.settings().get('color_scheme'). I suspect you are either modifying a wrong color scheme or using a wrong color scheme. I am .sublime-color-scheme-ism anyway.

0 Likes

#17

'Packages/Colab Color Theme/Colab.tmTheme'

0 Likes

#18

I don’t know what’s happening then :frowning:

In case somehow you missed Sublime Text 3 light color scheme/theme in Colab style as a .sublime-color-scheme working proof.

0 Likes

#19

Thank you. I reinstall sublime and it feels like it works now.

0 Likes

#20

I managed to fix most of the colors. But when I try to change line 8 and 31 other colors get mismatch:

import numpy as np
from matplotlib import pyplot as plt

ys = 200 + np.random.randn(100)
x = [x for x in range(len(ys))]

plt.plot(x, ys, '-')
plt.fill_between(x, ys, 195, where=(ys > 195), facecolor='g', alpha=0.6, **kwargs)

plt.title("Sample Visualization")
plt.show()

thisdict = {
    "brand": "Ford",
    "model": "Mustang",
    "year": 1964
}


@protected(check_valid_user)
def do_upload_ajax():
    if data.file:
        size = 0


class Edges(Start):
    def __init__(self, text, **kwargs):
        self.created_utc = 1581863479.0


re.search(r"[^/\\&\?]+\.\w{3,4}(?=([\?&].*$|$))", url)
re.search(r'[^/\\&\?]+\.\w{3,4}(?=([\?&].*$|$))', url)
{
    "name": "Colab",
    "author": "Unknown",
    "variables":
    {
        "black": "#000000",
        "black2": "#003300",
        "blue": "#a11919",  // red string
        "blue2": "#b0d4ff", // blue selection
        "blue3": "#10895a", // green numbers
        "blue4": "#445588",
        "blue5": "#2e7d99", // class inheritance
        "green": "#63a35c",
        "green2": "#009926",
        "grey": "#969896",
        "grey2": "#333333",
        "orange": "#786027",
        "orange2": "#f2c6ab",
        "pink": "#990073",
        "purple": "#b000db",
        "purple2": "#2c00fe", // blue func, class
        "purple3": "#795da3",
        "purple4": "#100080",
        "red": "#f93232",
        "red2": "#770000",
        "white": "#ffdddd",
        "white2": "#fafafa",
        "white3": "#f7f7f7",
        "white4": "#ececec",
        "white5": "#e0e0e0",
        "white6": "#ddffdd",
        "yellow": "#75715e"
    },
    "globals":
    {
        "foreground": "var(black)",
        "background": "var(white3)",
        "caret": "var(black)",
        "invisibles": "var(white5)",
        "line_highlight": "var(white2)",
        "selection": "var(blue2)",
        "selection_border": "var(blue2)",
        "inactive_selection": "var(white3)",
        "find_highlight_foreground": "var(black)",
        "find_highlight": "var(orange2)"
    },
    "rules":
    [
        {
            "name": "Comments",
            "scope": "comment",
            "foreground": "var(grey)"
        },
        {
            "name": "Operators",
            "scope": "keyword.operator, support.constant",
            "foreground": "var(black)"
        },
        {
            "name": "Operators",
            "scope": "constant.language",
            "foreground": "var(blue3)"
        },
        {
            "name": "Keywords",
            "scope": "keyword, storage",
            "foreground": "var(purple)"
        },
        {
            "name": "Types",
            "scope": "storage.type",
            "foreground": "var(purple2)"
        },
        {
            "name": "Types",
            "scope": "support.type",
            "foreground": "var(black)"
        },
        {
            "scope": "variable.annotation.function, punctuation.definition.annotation",
            "foreground": "var(orange)"
        },
        {
            "scope": "keyword.control.flow.for.in",
            "foreground": "var(purple2)"
        },
        {
            "scope": "variable",
            "foreground": "var(black)"
        },
        {
            "scope": "variable.language, variable.parameter",
            "foreground": "var(purple4)"
        },
        {
            "scope": "variable.parameter.function",
            "foreground": "var(grey2)"
        },
        {
            "name": "Functions",
            "scope": "entity.name.function, entity",
            "foreground": "var(orange)"
        },
        {
            "name": "Functions",
            "scope": "support.function",
            "foreground": "var(orange)"
        },
        {
            "name": "Classes",
            "scope": "entity.name.class, entity.name.type, entity.other.inherited-class",
            "foreground": "var(blue5)"
        },
        {
            "name": "Classes",
            "scope": "support.class",
            "foreground": "var(blue3)"
        },
        {
            "name": "Exceptions",
            "scope": "entity.name.exception",
            "foreground": "var(red)"
        },
        {
            "name": "Sections",
            "scope": "entity.name.section"
        },
        {
            "name": "Numbers",
            "scope": "constant.numeric, constant",
            "foreground": "var(blue3)"
        },
        {
            "name": "Strings",
            "scope": "constant.character, string, string punctuation",
            "foreground": "var(blue)"
        },
        {
            "name": "Strings: Regular Expressions",
            "scope": "string.regexp, string.regexp constant.character, string.regexp punctuation",
            "foreground": "var(green2)"
        },
        {
            "name": "Strings: Symbols",
            "scope": "constant.other.symbol",
            "foreground": "var(pink)"
        },
        {
            "name": "Embedded Source",
            "scope": "string source, text source",
            "foreground": "var(grey2)"
        },
        {
            "scope": "variable.other.property",
            "foreground": "var(grey2)"
        },
        {
            "scope": "entity.name",
            "foreground": "var(grey2)"
        },
        {
            "scope": "invalid",
            "foreground": "var(black)"
        },
        {
            "name": "HTML: Tags",
            "scope": "entity.name.tag",
            "foreground": "var(green)"
        },
        {
            "name": "HTML: Tags Punctuation",
            "scope": "punctuation.definition.tag",
            "foreground": "var(grey2)"
        },
        {
            "name": "HTML: Attribute Punctuation",
            "scope": "meta.tag string punctuation",
            "foreground": "var(blue)"
        },
        {
            "name": "HTML: Entities",
            "scope": "constant.character.entity",
            "foreground": "var(black)"
        },
        {
            "name": "HTML: Attribute Names",
            "scope": "entity.other.attribute-name",
            "foreground": "var(purple3)"
        },
        {
            "name": "HTML: Attribute Values",
            "scope": "meta.tag string.quoted, meta.tag string.quoted constant.character.entity",
            "foreground": "var(blue)"
        },
        {
            "scope": "meta.selector, meta.selector entity, meta.selector entity punctuation, entity.name.tag.css, entity.other.attribute-name.class, keyword.control.html.sass",
            "foreground": "var(green)"
        },
        {
            "scope": "entity.other.attribute-name.class, constant.other.unit",
            "foreground": "var(purple3)"
        },
        {
            "scope": "support.type.property-name, support.constant.property-value",
            "foreground": "var(blue3)"
        },
        {
            "scope": "keyword.other.special-method.ruby.gem",
            "foreground": "var(blue3)"
        },
        {
            "scope": "variable.other.block.ruby",
            "foreground": "var(black)"
        },
        {
            "scope": "support.function.prelude, variable.other.generic-type.haskell",
            "foreground": "var(black)"
        },
        {
            "scope": "constant.other.haskell, support.constant.haskell",
            "foreground": "var(blue4)"
        },
        {
            "name": "diff.header",
            "scope": "meta.diff, meta.diff.header",
            "foreground": "var(yellow)"
        },
        {
            "name": "diff.deleted",
            "scope": "markup.deleted",
            "foreground": "var(red2)",
            "background": "var(white)"
        },
        {
            "name": "diff.inserted",
            "scope": "markup.inserted",
            "foreground": "var(black2)",
            "background": "var(white6)"
        },
        {
            "name": "diff.changed",
            "scope": "markup.changed",
            "foreground": "var(white4)"
        }
    ]
}
0 Likes