Class: DailyImage::Config
- Inherits:
-
Object
- Object
- DailyImage::Config
- Includes:
- Singleton
- Defined in:
- lib/daily_image/config.rb
Instance Attribute Summary collapse
-
#bg_color ⇒ Object
背景颜色.
-
#date_color ⇒ Object
中间日期颜色.
-
#font ⇒ Object
文字默认字体.
-
#frame_color ⇒ Object
边框颜色.
-
#in_frame_offset ⇒ Object
下半部分内层边框偏移量.
-
#out_frame_offset ⇒ Object
外层边框偏移量.
-
#text_color ⇒ Object
文字颜色.
-
#unused_color ⇒ Object
进度条未使用颜色.
-
#used_color ⇒ Object
进度条已使用颜色.
Instance Method Summary collapse
Instance Attribute Details
#bg_color ⇒ Object
背景颜色
8 9 10 |
# File 'lib/daily_image/config.rb', line 8 def bg_color @bg_color end |
#date_color ⇒ Object
中间日期颜色
17 18 19 |
# File 'lib/daily_image/config.rb', line 17 def date_color @date_color end |
#font ⇒ Object
文字默认字体
26 27 28 |
# File 'lib/daily_image/config.rb', line 26 def font @font end |
#frame_color ⇒ Object
边框颜色
11 12 13 |
# File 'lib/daily_image/config.rb', line 11 def frame_color @frame_color end |
#in_frame_offset ⇒ Object
下半部分内层边框偏移量
32 33 34 |
# File 'lib/daily_image/config.rb', line 32 def in_frame_offset @in_frame_offset end |
#out_frame_offset ⇒ Object
外层边框偏移量
29 30 31 |
# File 'lib/daily_image/config.rb', line 29 def out_frame_offset @out_frame_offset end |
#text_color ⇒ Object
文字颜色
14 15 16 |
# File 'lib/daily_image/config.rb', line 14 def text_color @text_color end |
#unused_color ⇒ Object
进度条未使用颜色
20 21 22 |
# File 'lib/daily_image/config.rb', line 20 def unused_color @unused_color end |
#used_color ⇒ Object
进度条已使用颜色
23 24 25 |
# File 'lib/daily_image/config.rb', line 23 def used_color @used_color end |
Instance Method Details
#configuration ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/daily_image/config.rb', line 34 def configuration @config ||= {}.tap do |config| config[:bg_color] = bg_color || [255, 255, 255] config[:frame_color] = frame_color || [100, 145, 170] config[:text_color] = text_color || [100, 145, 170] config[:date_color] = date_color || [100, 145, 170] config[:unused_color] = unused_color || [200, 205, 215] config[:used_color] = used_color || [100, 145, 170] config[:out_frame_offset] = out_frame_offset || 15 config[:in_frame_offset] = in_frame_offset || 50 config[:font] = font || 'Hiragino Sans GB' end end |