textkolor 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5e8bb76f403a8ebfd9fdb4c44049a1e3c98b8eae
4
+ data.tar.gz: e382dd4a73ce1eeee92dd6eb9384d1d69c8c9cbe
5
+ SHA512:
6
+ metadata.gz: f98eb8c282d4cd70c884f8b44f6ccee66a3fc1af7c48beb351aca0dae1ec016caf9ff4858cc9eb5a030417bc5f9edf3589f213da42f98ee0cb1c87df6bf12067
7
+ data.tar.gz: 0da4fb0fc9f634fa1bd37db7ab7347f4888e9107c0a518835518c6cc173727cb1e1fd938ebed01358f3d7e3ea9354f2c0415f0d5b878f1d76489e2fa828fefdf
@@ -0,0 +1,3 @@
1
+ module Textkolor
2
+ VERSION = "0.0.1"
3
+ end
data/lib/textkolor.rb ADDED
@@ -0,0 +1,16 @@
1
+ def textkolor(str)
2
+ hash = 11
3
+ for i in 0..str.length-1
4
+ hash = str[i].ord + ((hash << 5) - hash)
5
+ end
6
+
7
+ colour = "#"
8
+
9
+
10
+ for j in (0).upto(4)
11
+ value = (hash >> (j * 8) & 0xFF)
12
+ colour += "00#{value.to_s(16)}"[-2]
13
+ end
14
+
15
+ colour
16
+ end
metadata ADDED
@@ -0,0 +1,48 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: textkolor
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Angel Botto
8
+ - Michel Perez
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-06-03 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: textKolor generate hex color from normal string.
15
+ email:
16
+ - angelbotto@gmail.com
17
+ - michel.ingesoft@gmail.com
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - lib/textkolor.rb
23
+ - lib/textkolor/version.rb
24
+ homepage: http://kreattiewe.com/kfriendly
25
+ licenses:
26
+ - MIT
27
+ metadata: {}
28
+ post_install_message:
29
+ rdoc_options: []
30
+ require_paths:
31
+ - lib
32
+ required_ruby_version: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - '>='
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ required_rubygems_version: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ requirements: []
43
+ rubyforge_project:
44
+ rubygems_version: 2.2.1
45
+ signing_key:
46
+ specification_version: 4
47
+ summary: Generate text color from string
48
+ test_files: []