sassafras 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ == 0.0.1 2008-12-14
2
+
3
+ * 1 major enhancement:
4
+ * Initial release
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2008 FIXME full name
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,32 @@
1
+ History.txt
2
+ License.txt
3
+ Manifest.txt
4
+ PostInstall.txt
5
+ README.txt
6
+ Rakefile
7
+ bin/sassafras
8
+ config/hoe.rb
9
+ config/requirements.rb
10
+ examples/analogous_red.html
11
+ examples/split_complementary_blue.html
12
+ lib/sassafras.rb
13
+ lib/sassafras/swatch.html.erb
14
+ lib/sassafras/version.rb
15
+ script/console
16
+ script/destroy
17
+ script/generate
18
+ script/txt2html
19
+ setup.rb
20
+ spec/sassafras_spec.rb
21
+ spec/spec.opts
22
+ spec/spec_helper.rb
23
+ tasks/deployment.rake
24
+ tasks/environment.rake
25
+ tasks/examples.rake
26
+ tasks/rspec.rake
27
+ tasks/website.rake
28
+ website/index.html
29
+ website/index.txt
30
+ website/javascripts/rounded_corners_lite.inc.js
31
+ website/stylesheets/screen.css
32
+ website/template.html.erb
@@ -0,0 +1,3 @@
1
+
2
+ For more information on sassafras, see http://github.com/teejayvanslyke/sassafras/
3
+
@@ -0,0 +1,86 @@
1
+ = sassafras
2
+
3
+ * http://www.elctech.com/projects/instant-sass-color-palettes-with-sassafras
4
+
5
+ == DESCRIPTION:
6
+
7
+ After spending hours copying and pasting hex values into my Sass stylesheets,
8
+ I knew there had to be a better way. Enter Sassafras, the Sass color scheme
9
+ generator.
10
+
11
+ Sassafras will generate any of the following types of color schemes and create
12
+ logically-named Sass variables for varying lightnesses:
13
+
14
+ * basic
15
+ * complementary
16
+ * analogous
17
+ * triadic
18
+ * split complementary
19
+ * rectangle
20
+ * square
21
+
22
+ == FEATURES/PROBLEMS:
23
+
24
+ == SYNOPSIS:
25
+
26
+ Generate basic variants of red:
27
+
28
+ $ sassafras -b red
29
+
30
+ # Generated by Sassafras
31
+ # base
32
+ !base_light = #ff8080
33
+ !base_darkest = #1a0000
34
+ !base_dark = #800000
35
+ !base_darker = #4d0000
36
+ !base_lightest = #ffe6e6
37
+ !base_mid = #ff0000
38
+ !base_lighter = #ffb3b3
39
+
40
+ Generate basic variants of red and green:
41
+
42
+ $ sassafras -t complementary -b red
43
+
44
+ Sassafras can also generate an HTML reference sheet with color swatches:
45
+
46
+ $ sassafras -t split_complementary -b blue -f html
47
+
48
+ For more information on the various types of color schemes supported by Sassafras,
49
+ please see the color theory tutorial on which Sassafras was based at http://www.tigercolor.com/color-lab/color-theory/color-theory-intro.htm
50
+
51
+ == REQUIREMENTS:
52
+
53
+ * color-tools
54
+ * activesupport
55
+
56
+ == INSTALL:
57
+
58
+ Note: Make sure you're using RubyGems >= 1.2.0.
59
+
60
+ $ sudo gem sources -a http://gems.github.com
61
+ $ sudo gem install teejayvanslyke-sassafras
62
+
63
+ == LICENSE:
64
+
65
+ (The MIT License)
66
+
67
+ Copyright (c) 2008 FIX
68
+
69
+ Permission is hereby granted, free of charge, to any person obtaining
70
+ a copy of this software and associated documentation files (the
71
+ 'Software'), to deal in the Software without restriction, including
72
+ without limitation the rights to use, copy, modify, merge, publish,
73
+ distribute, sublicense, and/or sell copies of the Software, and to
74
+ permit persons to whom the Software is furnished to do so, subject to
75
+ the following conditions:
76
+
77
+ The above copyright notice and this permission notice shall be
78
+ included in all copies or substantial portions of the Software.
79
+
80
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
81
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
82
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
83
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
84
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
85
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
86
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,38 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |s|
7
+ s.name = "sassafras"
8
+ s.executables = "sassafras"
9
+ s.summary = "Sass color scheme generator"
10
+ s.description = "Sass color scheme generator"
11
+ s.email = "teejay.vanslyke@gmail.com"
12
+ s.homepage = "http://github.com/teejayvanslyke/sassafras"
13
+ s.authors = ["T.J. VanSlyke"]
14
+ s.files = ["History.txt", "License.txt", "Manifest.txt", "PostInstall.txt", "README.txt", "Rakefile", "bin/sassafras", "config/hoe.rb", "config/requirements.rb", "examples/analogous_red.html", "examples/split_complementary_blue.html", "lib/sassafras.rb", "lib/sassafras/swatch.html.erb", "lib/sassafras/version.rb", "script/console", "script/destroy", "script/generate", "script/txt2html", "setup.rb", "spec/sassafras_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "tasks/deployment.rake", "tasks/environment.rake", "tasks/examples.rake", "tasks/rspec.rake", "tasks/website.rake", "website/index.html", "website/index.txt", "website/javascripts/rounded_corners_lite.inc.js", "website/stylesheets/screen.css", "website/template.html.erb"]
15
+ s.add_development_dependency "rspec"
16
+ s.add_dependency("color-tools", [">= 1.3.0"])
17
+ s.add_dependency("activesupport", [">= 1.3.0"])
18
+ end
19
+ rescue LoadError
20
+ puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
21
+ end
22
+
23
+ require 'spec/rake/spectask'
24
+ Spec::Rake::SpecTask.new(:spec) do |spec|
25
+ spec.libs << 'lib' << 'spec'
26
+ spec.spec_files = FileList['spec/**/*_spec.rb']
27
+ end
28
+
29
+ Spec::Rake::SpecTask.new(:rcov) do |spec|
30
+ spec.libs << 'lib' << 'spec'
31
+ spec.pattern = 'spec/**/*_spec.rb'
32
+ spec.rcov = true
33
+ end
34
+
35
+ task :spec => :check_dependencies
36
+
37
+
38
+ task :default => :spec
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Created on 2008-12-14.
4
+ # Copyright (c) 2008. All rights reserved.
5
+
6
+ begin
7
+ require 'sassafras'
8
+ rescue LoadError
9
+ require 'rubygems'
10
+ gem 'sassafras'
11
+ require 'sassafras'
12
+ end
13
+
14
+ require 'optparse'
15
+
16
+ # NOTE: the option -p/--path= is given as an example, and should probably be replaced in your application.
17
+
18
+ OPTIONS = {
19
+ :type => 'basic',
20
+ :format => 'sass'
21
+ }
22
+ MANDATORY_OPTIONS = %w(base)
23
+
24
+ parser = OptionParser.new do |opts|
25
+ opts.banner = <<BANNER
26
+
27
+ Sassafras v#{Sassafras::VERSION::STRING} makes you sexy!
28
+
29
+ Usage: #{File.basename($0)} [options]
30
+
31
+ Options are:
32
+ BANNER
33
+ opts.separator ""
34
+ opts.on("-b", "--base=BASE", String,
35
+ "The base color for the color theme",
36
+ "Required.") { |OPTIONS[:base]| }
37
+ opts.on("-t", "--type=TYPE", String,
38
+ "Type of color scheme (basic|complementary|analogous|triadic|split_complementary|rectangle|square)",
39
+ "Default: basic") { |OPTIONS[:type]| }
40
+ opts.on('-f', '--format=FORMAT', String,
41
+ "Format (sass|html)",
42
+ "Default: sass") { |OPTIONS[:format]| }
43
+ opts.on("-h", "--help",
44
+ "Show this help message.") { puts opts; exit }
45
+ opts.parse!(ARGV)
46
+
47
+ if MANDATORY_OPTIONS && MANDATORY_OPTIONS.find { |option| OPTIONS[option.to_sym].nil? }
48
+ puts opts; exit
49
+ end
50
+ end
51
+
52
+ path = OPTIONS[:path]
53
+
54
+ theme = Sassafras::Theme.create(OPTIONS[:type], OPTIONS[:base])
55
+
56
+ if OPTIONS[:format] == 'html'
57
+ Sassafras::HTMLSwatch.new(theme)
58
+ else
59
+ puts theme.sass
60
+ end
61
+
62
+
@@ -0,0 +1,298 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
4
+ <head>
5
+ <title>Sassafras Swatch</title>
6
+ <meta http-equiv="content-type" content="text/xhtml; charset=utf-8" />
7
+ <meta http-equiv="imagetoolbar" content="no" />
8
+ <meta name="distribution" content="all" />
9
+ <meta name="robots" content="all" />
10
+ <meta name="resource-type" content="document" />
11
+ <meta name="MSSmartTagsPreventParsing" content="true" />
12
+ <style type="text/css">
13
+ body {
14
+ font-family: Helvetica, Verdana, Sans-serif;
15
+ text-align: center;
16
+ }
17
+ .container {
18
+ width: 600px;
19
+ }
20
+ th {
21
+ text-align: left;
22
+ }
23
+ td.swatch {
24
+ width: 10em;
25
+ }
26
+ td.hex {
27
+ font-family: "Courier New", Fixed;
28
+ }
29
+ pre {
30
+ text-align: left;
31
+ }
32
+ </style>
33
+ </head>
34
+ <body>
35
+ <div align="center">
36
+ <div class="container">
37
+ <h1>Sassafras</h1>
38
+ <table width="100%">
39
+
40
+ <tr>
41
+ <th colspan="3">accent</td>
42
+ </tr>
43
+
44
+ <tr>
45
+ <td>
46
+ dark
47
+ </td>
48
+ <td class="hex">
49
+ #802a00
50
+ </td>
51
+ <td class="swatch" style="background-color: #802a00;">&nbsp;</td>
52
+ </tr>
53
+
54
+ <tr>
55
+ <td>
56
+ darker
57
+ </td>
58
+ <td class="hex">
59
+ #4d1900
60
+ </td>
61
+ <td class="swatch" style="background-color: #4d1900;">&nbsp;</td>
62
+ </tr>
63
+
64
+ <tr>
65
+ <td>
66
+ light
67
+ </td>
68
+ <td class="hex">
69
+ #ffaa80
70
+ </td>
71
+ <td class="swatch" style="background-color: #ffaa80;">&nbsp;</td>
72
+ </tr>
73
+
74
+ <tr>
75
+ <td>
76
+ lightest
77
+ </td>
78
+ <td class="hex">
79
+ #ffeee6
80
+ </td>
81
+ <td class="swatch" style="background-color: #ffeee6;">&nbsp;</td>
82
+ </tr>
83
+
84
+ <tr>
85
+ <td>
86
+ lighter
87
+ </td>
88
+ <td class="hex">
89
+ #ffccb3
90
+ </td>
91
+ <td class="swatch" style="background-color: #ffccb3;">&nbsp;</td>
92
+ </tr>
93
+
94
+ <tr>
95
+ <td>
96
+ mid
97
+ </td>
98
+ <td class="hex">
99
+ #ff5500
100
+ </td>
101
+ <td class="swatch" style="background-color: #ff5500;">&nbsp;</td>
102
+ </tr>
103
+
104
+ <tr>
105
+ <td>
106
+ darkest
107
+ </td>
108
+ <td class="hex">
109
+ #1a0800
110
+ </td>
111
+ <td class="swatch" style="background-color: #1a0800;">&nbsp;</td>
112
+ </tr>
113
+
114
+
115
+ <tr>
116
+ <th colspan="3">support</td>
117
+ </tr>
118
+
119
+ <tr>
120
+ <td>
121
+ dark
122
+ </td>
123
+ <td class="hex">
124
+ #80002a
125
+ </td>
126
+ <td class="swatch" style="background-color: #80002a;">&nbsp;</td>
127
+ </tr>
128
+
129
+ <tr>
130
+ <td>
131
+ darker
132
+ </td>
133
+ <td class="hex">
134
+ #4d0019
135
+ </td>
136
+ <td class="swatch" style="background-color: #4d0019;">&nbsp;</td>
137
+ </tr>
138
+
139
+ <tr>
140
+ <td>
141
+ light
142
+ </td>
143
+ <td class="hex">
144
+ #ff80aa
145
+ </td>
146
+ <td class="swatch" style="background-color: #ff80aa;">&nbsp;</td>
147
+ </tr>
148
+
149
+ <tr>
150
+ <td>
151
+ lightest
152
+ </td>
153
+ <td class="hex">
154
+ #ffe6ee
155
+ </td>
156
+ <td class="swatch" style="background-color: #ffe6ee;">&nbsp;</td>
157
+ </tr>
158
+
159
+ <tr>
160
+ <td>
161
+ lighter
162
+ </td>
163
+ <td class="hex">
164
+ #ffb3cc
165
+ </td>
166
+ <td class="swatch" style="background-color: #ffb3cc;">&nbsp;</td>
167
+ </tr>
168
+
169
+ <tr>
170
+ <td>
171
+ mid
172
+ </td>
173
+ <td class="hex">
174
+ #ff0055
175
+ </td>
176
+ <td class="swatch" style="background-color: #ff0055;">&nbsp;</td>
177
+ </tr>
178
+
179
+ <tr>
180
+ <td>
181
+ darkest
182
+ </td>
183
+ <td class="hex">
184
+ #1a0008
185
+ </td>
186
+ <td class="swatch" style="background-color: #1a0008;">&nbsp;</td>
187
+ </tr>
188
+
189
+
190
+ <tr>
191
+ <th colspan="3">base</td>
192
+ </tr>
193
+
194
+ <tr>
195
+ <td>
196
+ dark
197
+ </td>
198
+ <td class="hex">
199
+ #800000
200
+ </td>
201
+ <td class="swatch" style="background-color: #800000;">&nbsp;</td>
202
+ </tr>
203
+
204
+ <tr>
205
+ <td>
206
+ darker
207
+ </td>
208
+ <td class="hex">
209
+ #4d0000
210
+ </td>
211
+ <td class="swatch" style="background-color: #4d0000;">&nbsp;</td>
212
+ </tr>
213
+
214
+ <tr>
215
+ <td>
216
+ light
217
+ </td>
218
+ <td class="hex">
219
+ #ff8080
220
+ </td>
221
+ <td class="swatch" style="background-color: #ff8080;">&nbsp;</td>
222
+ </tr>
223
+
224
+ <tr>
225
+ <td>
226
+ lightest
227
+ </td>
228
+ <td class="hex">
229
+ #ffe6e6
230
+ </td>
231
+ <td class="swatch" style="background-color: #ffe6e6;">&nbsp;</td>
232
+ </tr>
233
+
234
+ <tr>
235
+ <td>
236
+ lighter
237
+ </td>
238
+ <td class="hex">
239
+ #ffb3b3
240
+ </td>
241
+ <td class="swatch" style="background-color: #ffb3b3;">&nbsp;</td>
242
+ </tr>
243
+
244
+ <tr>
245
+ <td>
246
+ mid
247
+ </td>
248
+ <td class="hex">
249
+ #ff0000
250
+ </td>
251
+ <td class="swatch" style="background-color: #ff0000;">&nbsp;</td>
252
+ </tr>
253
+
254
+ <tr>
255
+ <td>
256
+ darkest
257
+ </td>
258
+ <td class="hex">
259
+ #1a0000
260
+ </td>
261
+ <td class="swatch" style="background-color: #1a0000;">&nbsp;</td>
262
+ </tr>
263
+
264
+
265
+ </table>
266
+ <pre># Generated by Sassafras
267
+ # accent
268
+ !accent_dark = #802a00
269
+ !accent_darker = #4d1900
270
+ !accent_light = #ffaa80
271
+ !accent_lightest = #ffeee6
272
+ !accent_lighter = #ffccb3
273
+ !accent_mid = #ff5500
274
+ !accent_darkest = #1a0800
275
+
276
+ # support
277
+ !support_dark = #80002a
278
+ !support_darker = #4d0019
279
+ !support_light = #ff80aa
280
+ !support_lightest = #ffe6ee
281
+ !support_lighter = #ffb3cc
282
+ !support_mid = #ff0055
283
+ !support_darkest = #1a0008
284
+
285
+ # base
286
+ !base_dark = #800000
287
+ !base_darker = #4d0000
288
+ !base_light = #ff8080
289
+ !base_lightest = #ffe6e6
290
+ !base_lighter = #ffb3b3
291
+ !base_mid = #ff0000
292
+ !base_darkest = #1a0000
293
+
294
+ </pre>
295
+ </div>
296
+ </div>
297
+ </body>
298
+ </html>