coloration 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -0,0 +1,27 @@
1
+ # Coloration
2
+
3
+ ## About
4
+
5
+ __Coloration__ is editor/IDE color scheme converter. Right now it allows you to convert your favourite Textmate color
6
+ scheme (in XML plist format) to Vim, JEdit and KDevelop/Kate/Kwrite color scheme. It tries to do its best to generate the most accurate
7
+ result for given target.
8
+
9
+ ## Installation && Usage
10
+
11
+ You can use Coloration in two ways: online or on your local machine. Online version is available
12
+ at [coloration.sickill.net](http://coloration.sickill.net/). If you like to install coloration on your own machine to
13
+ do some batch conversion or for some other reason just run:
14
+
15
+ gem install coloration
16
+
17
+ It gives you _tm2vim_, _tm2jedit_ and _tm2katepart_ binaries to do the conversion on command line.
18
+
19
+ ## Contact
20
+
21
+ If you found a bug or want to look at the source code you should go to [githubs](http://github.com/sickill/coloration).
22
+ Also if you tried to convert a theme and coloration failed or result is not quite good, please report an issue
23
+ at [issue tracker](http://github.com/sickill/coloration/issues).
24
+
25
+ ## Author
26
+
27
+ Coloration was created by Marcin Kulik ([sickill.net](http://sickill.net/))
@@ -1,7 +1,7 @@
1
1
  module Coloration
2
2
 
3
3
  class Style
4
- attr_accessor :foreground, :background, :bold, :italic, :underline, :strike, :inverse
4
+ attr_accessor :foreground, :background, :bold, :italic, :underline, :strike, :inverse, :comment
5
5
 
6
6
  def initialize(obj=nil, bg=nil)
7
7
  if obj
@@ -16,15 +16,15 @@ module Coloration
16
16
 
17
17
  def initialize_from_hash(h, bg=nil)
18
18
  h.each do |key, value|
19
- if value.is_a?(String)
20
- value = Color::RGBA.from_html(value, bg)
21
- end
22
19
  if key == :fg
23
20
  key = :foreground
24
21
  end
25
22
  if key == :bg
26
23
  key = :background
27
24
  end
25
+ if ["foreground", "background"].include?(key.to_s) && value.is_a?(String)
26
+ value = Color::RGBA.from_html(value, bg)
27
+ end
28
28
  send("#{key}=", value)
29
29
  end
30
30
  end
@@ -1,3 +1,3 @@
1
1
  module Coloration
2
- VERSION = "0.2.1".freeze
2
+ VERSION = "0.2.2".freeze
3
3
  end
@@ -19,7 +19,7 @@ module Coloration
19
19
 
20
20
  default_style = Style.new(:fg => @ui["foreground"])
21
21
  search_style = @items["variable"] || @items["entity"] || @items["keyword"] || default_style
22
- border_color = @ui["background"].lighten_by(81)
22
+ border_color = @ui["background"].mix_with(@ui["foreground"], 81)
23
23
 
24
24
  ui_mapping = {
25
25
  "Cursor" => Style.new(:bg => @ui["caret"]),
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 1
9
- version: 0.2.1
8
+ - 2
9
+ version: 0.2.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Marcin Kulik