Module: Wordcram::Style
- Included in:
- Sketch
- Defined in:
- lib/wordcram/styles/styles.rb
Instance Method Summary collapse
-
#angled_at(angle) ⇒ Object
Angler.
- #angled_between(from, to) ⇒ Object
- #black ⇒ Object
- #blue ⇒ Object
- #center_clump ⇒ Object
-
#colors(*colors) ⇒ Object
Color.
-
#create_placer(name) ⇒ Object
Placer.
-
#fonts(*fonts) ⇒ Object
Font.
-
#from(content, options = {}) ⇒ Object
Sources.
- #green ⇒ Object
- #horiz_band_anchored_left ⇒ Object
-
#horizontal_line ⇒ Object
Bundled Placers.
- #orange ⇒ Object
- #placer(placer = nil, &block) ⇒ Object
- #red ⇒ Object
- #sized_by_rank(options) ⇒ Object
-
#sized_by_weight(options) ⇒ Object
Sizer.
- #swirl ⇒ Object
-
#text_case(option) ⇒ Object
Case.
- #upper_left ⇒ Object
- #wave ⇒ Object
- #white ⇒ Object
-
#word_padding(padding) ⇒ Object
Padding.
- #yellow ⇒ Object
Instance Method Details
#angled_at(angle) ⇒ Object
Angler
8 9 10 |
# File 'lib/wordcram/styles/styles.rb', line 8 def angled_at(angle) wordcram.angled_at(angle) end |
#angled_between(from, to) ⇒ Object
12 13 14 |
# File 'lib/wordcram/styles/styles.rb', line 12 def angled_between(from, to) wordcram.angled_between(from, to) end |
#black ⇒ Object
52 53 54 |
# File 'lib/wordcram/styles/styles.rb', line 52 def black color(0, 0, 0) end |
#blue ⇒ Object
40 41 42 |
# File 'lib/wordcram/styles/styles.rb', line 40 def blue color(0, 0, 255) end |
#center_clump ⇒ Object
143 144 145 |
# File 'lib/wordcram/styles/styles.rb', line 143 def center_clump Java.wordcram.Placers.center_clump end |
#colors(*colors) ⇒ Object
Color
32 33 34 35 36 37 38 |
# File 'lib/wordcram/styles/styles.rb', line 32 def colors(*colors) if colors.size == 1 wordcram.with_color(*colors) else wordcram.with_colors(*colors) end end |
#create_placer(name) ⇒ Object
Placer
119 120 121 122 123 |
# File 'lib/wordcram/styles/styles.rb', line 119 def create_placer(name) placer = send(name) rescue NoMethodError placer = '' end |
#fonts(*fonts) ⇒ Object
Font
73 74 75 76 77 78 79 |
# File 'lib/wordcram/styles/styles.rb', line 73 def fonts(*fonts) if fonts.size == 1 wordcram.with_font(*fonts) else wordcram.with_fonts(*fonts) end end |
#from(content, options = {}) ⇒ Object
Sources
108 109 110 111 112 |
# File 'lib/wordcram/styles/styles.rb', line 108 def from(content, = {}) wordcram.send(:"from_#{[:as]}", content) rescue NoMethodError wordcram.send(:from_text_string, content) end |
#green ⇒ Object
44 45 46 |
# File 'lib/wordcram/styles/styles.rb', line 44 def green color(0, 255, 0) end |
#horiz_band_anchored_left ⇒ Object
147 148 149 |
# File 'lib/wordcram/styles/styles.rb', line 147 def horiz_band_anchored_left Java.wordcram.Placers.horiz_band_anchored_left end |
#horizontal_line ⇒ Object
Bundled Placers
139 140 141 |
# File 'lib/wordcram/styles/styles.rb', line 139 def horizontal_line Java.wordcram.Placers.horiz_line end |
#orange ⇒ Object
48 49 50 |
# File 'lib/wordcram/styles/styles.rb', line 48 def orange color(255, 127, 0) end |
#placer(placer = nil, &block) ⇒ Object
125 126 127 128 129 130 131 132 |
# File 'lib/wordcram/styles/styles.rb', line 125 def placer(placer=nil, &block) if placer.nil? placer = Placer.new &block else placer = create_placer(placer) end wordcram.with_placer(placer) end |
#red ⇒ Object
64 65 66 |
# File 'lib/wordcram/styles/styles.rb', line 64 def red color(255, 0, 0) end |
#sized_by_rank(options) ⇒ Object
99 100 101 |
# File 'lib/wordcram/styles/styles.rb', line 99 def sized_by_rank() wordcram.sized_by_rank([:min], [:max]) end |
#sized_by_weight(options) ⇒ Object
Sizer
95 96 97 |
# File 'lib/wordcram/styles/styles.rb', line 95 def sized_by_weight() wordcram.sized_by_weight([:min], [:max]) end |
#swirl ⇒ Object
151 152 153 |
# File 'lib/wordcram/styles/styles.rb', line 151 def swirl Java.wordcram.Placers.swirl end |
#text_case(option) ⇒ Object
Case
21 22 23 24 25 |
# File 'lib/wordcram/styles/styles.rb', line 21 def text_case(option) wordcram.send :"#{option}_case" rescue NoMethodError wordcram.keep_case end |
#upper_left ⇒ Object
155 156 157 |
# File 'lib/wordcram/styles/styles.rb', line 155 def upper_left Java.wordcram.Placers.upper_left end |
#wave ⇒ Object
159 160 161 |
# File 'lib/wordcram/styles/styles.rb', line 159 def wave Java.wordcram.Placers.wave end |
#white ⇒ Object
56 57 58 |
# File 'lib/wordcram/styles/styles.rb', line 56 def white color(255, 255, 255) end |
#word_padding(padding) ⇒ Object
Padding
86 87 88 |
# File 'lib/wordcram/styles/styles.rb', line 86 def word_padding(padding) wordcram.with_word_padding(padding) end |
#yellow ⇒ Object
60 61 62 |
# File 'lib/wordcram/styles/styles.rb', line 60 def yellow color(255, 255, 0) end |