text_to_color-rails 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +4 -0
- data/Changelog.md +0 -0
- data/Gemfile +2 -0
- data/Rakefile +5 -0
- data/Readme.md +19 -0
- data/app/assets/javascripts/text_to_color.js +13 -0
- data/lib/text_to_color-rails.rb +2 -0
- data/lib/texttocolor/rails.rb +6 -0
- data/lib/texttocolor/version.rb +3 -0
- data/text_to_color-rails.gemspec +25 -0
- metadata +133 -0
data/.travis.yml
ADDED
data/Changelog.md
ADDED
File without changes
|
data/Gemfile
ADDED
data/Rakefile
ADDED
data/Readme.md
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
## Installation
|
2
|
+
|
3
|
+
Add the gem to the Gemfile:
|
4
|
+
|
5
|
+
gem "text_to_color-rails"
|
6
|
+
|
7
|
+
## Usage
|
8
|
+
|
9
|
+
In your JavaScript manifest (e.g. `application.js`):
|
10
|
+
|
11
|
+
//= require text_to_color
|
12
|
+
|
13
|
+
|
14
|
+
## Licensing
|
15
|
+
|
16
|
+
|
17
|
+
The gem itself is released under the MIT license
|
18
|
+
|
19
|
+
:pray:
|
@@ -0,0 +1,13 @@
|
|
1
|
+
var TextToColour = function(str) {
|
2
|
+
var hash = 0;
|
3
|
+
for (var i = 0; i < str.length; i++) {
|
4
|
+
hash = str.charCodeAt(i) + ((hash << 5) - hash);
|
5
|
+
}
|
6
|
+
var colour = '#';
|
7
|
+
for (var i = 0; i < 3; i++) {
|
8
|
+
var value = (hash >> (i * 8)) & 0xFF;
|
9
|
+
colour += ('00' + value.toString(16)).substr(-2);
|
10
|
+
}
|
11
|
+
return colour;
|
12
|
+
}
|
13
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "texttocolor/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "text_to_color-rails"
|
7
|
+
s.version = Texttocolor::VERSION
|
8
|
+
s.authors = ["Nikita Singh"]
|
9
|
+
s.date = '2014-02-21'
|
10
|
+
s.email = ["nikitaa_singh@yahoo.co.in"]
|
11
|
+
s.summary = %q{Gem for a converting a string to hexadecimal color code}
|
12
|
+
s.description = %q{Gem for a converting a string to hexadecimal color code in javascript}
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
s.licenses = ['MIT']
|
19
|
+
s.homepage = 'https://github.com/gemathon-rockets/text_to_color-rails'
|
20
|
+
s.add_dependency "railties", ">= 3.1"
|
21
|
+
s.add_development_dependency "bundler", "~> 1.0"
|
22
|
+
s.add_development_dependency "rails", ">= 3.1"
|
23
|
+
s.add_development_dependency 'rake'
|
24
|
+
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,133 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: text_to_color-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Nikita Singh
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2014-02-21 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: railties
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 5
|
29
|
+
segments:
|
30
|
+
- 3
|
31
|
+
- 1
|
32
|
+
version: "3.1"
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: bundler
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 15
|
44
|
+
segments:
|
45
|
+
- 1
|
46
|
+
- 0
|
47
|
+
version: "1.0"
|
48
|
+
type: :development
|
49
|
+
version_requirements: *id002
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
name: rails
|
52
|
+
prerelease: false
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 5
|
59
|
+
segments:
|
60
|
+
- 3
|
61
|
+
- 1
|
62
|
+
version: "3.1"
|
63
|
+
type: :development
|
64
|
+
version_requirements: *id003
|
65
|
+
- !ruby/object:Gem::Dependency
|
66
|
+
name: rake
|
67
|
+
prerelease: false
|
68
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
hash: 3
|
74
|
+
segments:
|
75
|
+
- 0
|
76
|
+
version: "0"
|
77
|
+
type: :development
|
78
|
+
version_requirements: *id004
|
79
|
+
description: Gem for a converting a string to hexadecimal color code in javascript
|
80
|
+
email:
|
81
|
+
- nikitaa_singh@yahoo.co.in
|
82
|
+
executables: []
|
83
|
+
|
84
|
+
extensions: []
|
85
|
+
|
86
|
+
extra_rdoc_files: []
|
87
|
+
|
88
|
+
files:
|
89
|
+
- .travis.yml
|
90
|
+
- Changelog.md
|
91
|
+
- Gemfile
|
92
|
+
- Rakefile
|
93
|
+
- Readme.md
|
94
|
+
- app/assets/javascripts/text_to_color.js
|
95
|
+
- lib/text_to_color-rails.rb
|
96
|
+
- lib/texttocolor/rails.rb
|
97
|
+
- lib/texttocolor/version.rb
|
98
|
+
- text_to_color-rails.gemspec
|
99
|
+
homepage: https://github.com/gemathon-rockets/text_to_color-rails
|
100
|
+
licenses:
|
101
|
+
- MIT
|
102
|
+
post_install_message:
|
103
|
+
rdoc_options: []
|
104
|
+
|
105
|
+
require_paths:
|
106
|
+
- lib
|
107
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
108
|
+
none: false
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
hash: 3
|
113
|
+
segments:
|
114
|
+
- 0
|
115
|
+
version: "0"
|
116
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
|
+
none: false
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
hash: 3
|
122
|
+
segments:
|
123
|
+
- 0
|
124
|
+
version: "0"
|
125
|
+
requirements: []
|
126
|
+
|
127
|
+
rubyforge_project:
|
128
|
+
rubygems_version: 1.8.25
|
129
|
+
signing_key:
|
130
|
+
specification_version: 3
|
131
|
+
summary: Gem for a converting a string to hexadecimal color code
|
132
|
+
test_files: []
|
133
|
+
|