Module: PSD::Layer::Helpers
- Included in:
- PSD::Layer
- Defined in:
- lib/psd/layer/helpers.rb
Instance Method Summary collapse
- #fill_opacity ⇒ Object
-
#folder? ⇒ Boolean
Does this layer represent the start of a folder section?.
-
#folder_end? ⇒ Boolean
Does this layer represent the end of a folder section?.
-
#hidden? ⇒ Boolean
Is this layer hidden?.
- #layer_type ⇒ Object
-
#text ⇒ Object
Helper that exports the text data in this layer, if any.
-
#visible? ⇒ Boolean
Is this layer visible?.
Instance Method Details
#fill_opacity ⇒ Object
47 48 49 50 |
# File 'lib/psd/layer/helpers.rb', line 47 def fill_opacity return 255 unless info.has_key?(:fill_opacity) info[:fill_opacity].enabled end |
#folder? ⇒ Boolean
Does this layer represent the start of a folder section?
5 6 7 8 9 10 11 12 13 |
# File 'lib/psd/layer/helpers.rb', line 5 def folder? if info.has_key?(:section_divider) info[:section_divider].is_folder elsif info.has_key?(:nested_section_divider) info[:nested_section_divider].is_folder else name == "<Layer group>" end end |
#folder_end? ⇒ Boolean
Does this layer represent the end of a folder section?
16 17 18 19 20 21 22 23 24 |
# File 'lib/psd/layer/helpers.rb', line 16 def folder_end? if info.has_key?(:section_divider) info[:section_divider].is_hidden elsif info.has_key?(:nested_section_divider) info[:nested_section_divider].is_hidden else name == "</Layer group>" end end |
#hidden? ⇒ Boolean
Is this layer hidden?
32 33 34 |
# File 'lib/psd/layer/helpers.rb', line 32 def hidden? !@visible end |
#layer_type ⇒ Object
42 43 44 45 |
# File 'lib/psd/layer/helpers.rb', line 42 def layer_type return 'normal' unless info.has_key?(:section_divider) info[:section_divider].layer_type end |
#text ⇒ Object
Helper that exports the text data in this layer, if any.
37 38 39 40 |
# File 'lib/psd/layer/helpers.rb', line 37 def text return nil unless info[:type] info[:type].to_hash end |
#visible? ⇒ Boolean
Is this layer visible?
27 28 29 |
# File 'lib/psd/layer/helpers.rb', line 27 def visible? @visible end |