Class: PhlexIcons::Flag::Cg

Inherits:
Base
  • Object
show all
Defined in:
lib/phlex-icons/flag/cg.rb

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Base

#initialize, #view_template

Constructor Details

This class inherits a constructor from PhlexIcons::Base

Instance Method Details

#rectangleObject



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/phlex-icons/flag/cg.rb', line 29

def rectangle
  svg(
    **attrs, xmlns: 'http://www.w3.org/2000/svg', viewbox: '0 0 640 480'
  ) do |s|
    s.defs do
      s.clipPath(id: 'cg-a') do
        s.path(fill_opacity: '.7', d: 'M-79.5 32h640v480h-640z')
      end
    end
    s.g(
      fill_rule: 'evenodd',
      stroke_width: '1pt',
      clip_path: 'url(#cg-a)',
      transform: 'translate(79.5 -32)'
    ) do
      s.path(fill: '#ff0', d: 'M-119.5 32h720v480h-720z')
      s.path(fill: '#00ca00', d: 'M-119.5 32v480l480-480z')
      s.path(fill: 'red', d: 'M120.5 512h480V32z')
    end
  end
end

#squareObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/phlex-icons/flag/cg.rb', line 7

def square
  svg(
    **attrs, xmlns: 'http://www.w3.org/2000/svg', viewbox: '0 0 512 512'
  ) do |s|
    s.defs do
      s.clipPath(id: 'cg-a') do
        s.path(fill_opacity: '.7', d: 'M115.7 0h496.1v496h-496z')
      end
    end
    s.g(
      fill_rule: 'evenodd',
      stroke_width: '1pt',
      clip_path: 'url(#cg-a)',
      transform: 'translate(-119.5)scale(1.032)'
    ) do
      s.path(fill: '#ff0', d: 'M0 0h744v496H0z')
      s.path(fill: '#00ca00', d: 'M0 0v496L496 0z')
      s.path(fill: 'red', d: 'M248 496h496V0z')
    end
  end
end