geo_pattern 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014 Jason Long
1
+ Copyright (c) 2014 GitHub, Inc.
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -1,9 +1,11 @@
1
1
  # GeoPattern
2
2
 
3
- Generate beautiful tilng SVG patterns from a string. The string is converted into a SHA and a color and pattern are determined based on the values in the hash. The color is determined by shifting the hue and saturation from a default (or passed in) base color. One of 16 patterns is used (or you can specify one) and the sizing of the pattern elements is also determined by the hash values.
3
+ Generate beautiful tiling SVG patterns from a string. The string is converted into a SHA and a color and pattern are determined based on the values in the hash. The color is determined by shifting the hue and saturation from a default (or passed in) base color. One of 16 patterns is used (or you can specify one) and the sizing of the pattern elements is also determined by the hash values.
4
4
 
5
5
  You can use the generated pattern as the `background-image` for a container. Using the `base64` representation of the pattern still results in SVG rendering, so it looks great on retina displays.
6
6
 
7
+ See the [GitHub Guides](http://guides.github.com) site as an example of this library in action.
8
+
7
9
  ## Installation
8
10
 
9
11
  Add this line to your application's Gemfile:
File without changes
@@ -658,6 +658,15 @@ module GeoPattern
658
658
  opacity = opacity(val)
659
659
  fill = fill_color(val)
660
660
 
661
+ styles = {
662
+ "fill" => "none",
663
+ "stroke" => fill,
664
+ "style" => {
665
+ "opacity" => opacity,
666
+ "stroke-width" => "#{block_size}px"
667
+ }
668
+ }
669
+
661
670
  svg.rect(x*square_size + x*block_size*2 + block_size/2 + block_size*2,
662
671
  y*square_size + y*block_size*2 + block_size/2 + block_size*2,
663
672
  block_size * 3, block_size * 3, styles)
@@ -678,15 +687,15 @@ module GeoPattern
678
687
 
679
688
  if (x % 2 == 0)
680
689
  if (y % 2 == 0)
681
- draw_outer_mosaic_tile(x*triangle_size*2, y*triangle_size*2, triangle_size, hash[i])
690
+ draw_outer_mosaic_tile(x*triangle_size*2, y*triangle_size*2, triangle_size, hex_val(i, 1))
682
691
  else
683
- draw_inner_mosaic_tile(x*triangle_size*2, y*triangle_size*2, triangle_size, hash[i..i+1])
692
+ draw_inner_mosaic_tile(x*triangle_size*2, y*triangle_size*2, triangle_size, [hex_val(i, 1), hex_val(i+1, 1)])
684
693
  end
685
694
  else
686
695
  if (y % 2 == 0)
687
- draw_inner_mosaic_tile(x*triangle_size*2, y*triangle_size*2, triangle_size, hash[i..i+1])
696
+ draw_inner_mosaic_tile(x*triangle_size*2, y*triangle_size*2, triangle_size, [hex_val(i, 1), hex_val(i+1, 1)])
688
697
  else
689
- draw_outer_mosaic_tile(x*triangle_size*2, y*triangle_size*2, triangle_size, hash[i])
698
+ draw_outer_mosaic_tile(x*triangle_size*2, y*triangle_size*2, triangle_size, hex_val(i, 1))
690
699
  end
691
700
  end
692
701
  i += 1
@@ -1,3 +1,3 @@
1
1
  module GeoPattern
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geo_pattern
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-24 00:00:00.000000000 Z
12
+ date: 2014-02-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: color
@@ -71,7 +71,7 @@ files:
71
71
  - LICENSE.txt
72
72
  - README.md
73
73
  - Rakefile
74
- - geopatterns.gemspec
74
+ - geo_pattern.gemspec
75
75
  - lib/geo_pattern.rb
76
76
  - lib/geo_pattern/pattern.rb
77
77
  - lib/geo_pattern/svg.rb