Module: Compass::Canvas::Functions::Pattern

Included in:
Compass::Canvas::Functions
Defined in:
lib/canvas/functions/pattern.rb

Overview

Functions for creating a Pattern interface.

Instance Method Summary collapse

Instance Method Details

#brush(*args) ⇒ Object

Constructs a paint pattern.

This function cannot be created in Sass as it is a variadic function.



15
16
17
# File 'lib/canvas/functions/pattern.rb', line 15

def brush(*args)
  canvas_pattern(Sass::Script::String.new(Compass::Canvas::Actions::BRUSH), *args)
end

#canvas_pattern(*args) ⇒ Compass::Canvas::Backend::Interface::Pattern

Returns:



8
9
10
# File 'lib/canvas/functions/pattern.rb', line 8

def canvas_pattern(*args)
  Compass::Canvas::Backend::Interface::Pattern.new(*args)
end

#dash_pattern(*args) ⇒ Object

Constructs a dash pattern array from positive On/Off lengths.

This function cannot be created in Sass as it is a variadic function.



22
23
24
# File 'lib/canvas/functions/pattern.rb', line 22

def dash_pattern(*args)
  canvas_pattern(Sass::Script::String.new(Compass::Canvas::Actions::DASH_PATTERN), *args)
end

#mask(*args) ⇒ Object

Constructs a mask from a canvas.

This function cannot be created in Sass as it is a variadic function.



29
30
31
# File 'lib/canvas/functions/pattern.rb', line 29

def mask(*args)
  canvas_pattern(Sass::Script::String.new(Compass::Canvas::Actions::MASK), *args)
end