rothko 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8231ddb5dd94ffe8bdf9186b6185af753bb5fcccb950bbc0500261bc03029921
4
- data.tar.gz: 580ac7d7094ae74e5fbc7c6c28098ab9aa0e1c35a6dfdd6dcb66dfe2871e13b1
3
+ metadata.gz: 2a35f7607e9e6bd3ab8455839fb9f87376c4c52c4517dd5fa737da94d1e95730
4
+ data.tar.gz: 75e453b1228ff7c15b5a9beee6c20bdb5e3bdaf9cb1146c66f13c3145c6d56b4
5
5
  SHA512:
6
- metadata.gz: a1773bc329a54acb920063164c0808b05f2ea3497f497160c99f80a1753c68c445655ac77cd1d8853e26a8eb909e5543defbb94f8414d7b77b4ff3c5a5d5b65a
7
- data.tar.gz: e427ea5aa5d0cefb3b3f44ddce4d13c577647cb8ed44aa91c3f41eb3fd070195050fed1e253fc2a35bf8c19c35fe707b8c8fe06969ec1211840aff63f8114312
6
+ metadata.gz: f9a0e4ea14924d6696206314923bcac877cc2bbb0ccc648b6ce4a2b17b9924cc885c63411cb123df768a5b553f61813f24b8385a74b7c8710bad61ffc8eaaf48
7
+ data.tar.gz: 7125e146a4d68315ca04ac1ff6ebe8b711071be045b8001864aab7cfb8463006254ae8b23fc28c63b5ddebf38d5481b9f536d39ec20dad2cf69a804fbcbe067d
@@ -1,3 +1,3 @@
1
1
  module Rothko
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/rothko.rb CHANGED
@@ -7,13 +7,13 @@ module Rothko
7
7
  class Drawing
8
8
 
9
9
  attr_accessor :img, :width
10
- attr_reader :pallette
10
+ attr_reader :palette
11
11
 
12
12
  include ChunkyPNG::Color
13
13
 
14
14
  # Pallette of default ANSI colors. Closest match is found from this hash,
15
15
  # so these may be altered to produce a more faithful image or change colors.
16
- @@pallette = {
16
+ @@palette = {
17
17
  "g" => [0,230,22],
18
18
  "G" => [0,176,14],
19
19
  "w" => [230,229,230],
@@ -50,7 +50,7 @@ module Rothko
50
50
 
51
51
  # Finds height of the image relative to provided width
52
52
  def get_height(img)
53
- new_height = img.height / (img.width / self.width)
53
+ new_height = img.height / (img.width.to_f / self.width.to_f)
54
54
  end
55
55
 
56
56
  # Iterates over each pixel of resized image to find closest color
@@ -64,11 +64,11 @@ module Rothko
64
64
  end.join
65
65
  end
66
66
 
67
- # Iterates over the pallette to find the most similar color
67
+ # Iterates over the palette to find the most similar color
68
68
  def find_closest_term_color(pixel_values)
69
69
  color = ""
70
70
  lil_dist = 195075
71
- @@pallette.each do |col_name, col_values|
71
+ @@palette.each do |col_name, col_values|
72
72
  dist = find_distance(col_values, pixel_values)
73
73
  if dist < lil_dist
74
74
  lil_dist = dist
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rothko
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Brennan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-10 00:00:00.000000000 Z
11
+ date: 2017-12-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Provides the 'Drawing' class which is initialized with a filepath and
14
14
  a width. The image will be processed and put to the terminal as a collection of