-
Notifications
You must be signed in to change notification settings - Fork 8
/
colorscheme.go
35 lines (28 loc) · 682 Bytes
/
colorscheme.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright 2016 The lime Authors.
// Use of this source code is governed by a 2-clause
// BSD-style license that can be found in the LICENSE file.
package sublime
import (
"path/filepath"
"github.com/limetext/sublime/textmate/theme"
)
// wrapper arount Theme implements backend.ColorScheme
type colorScheme struct {
*theme.Theme
}
func newColorScheme(path string) (*colorScheme, error) {
if tm, err := theme.Load(path); err != nil {
return nil, err
} else {
return &colorScheme{tm}, nil
}
}
func (c *colorScheme) Name() string {
return c.Theme.Name
}
func isColorScheme(path string) bool {
if filepath.Ext(path) == ".tmTheme" {
return true
}
return false
}