Sha256: fdc2d2f3410194020d5a522ee6f6f5af5a56d93d644ec0a98468e96e9435baf9

Contents?: true

Size: 1.29 KB

Versions: 72

Compression:

Stored size: 1.29 KB

Contents

require 'glimmer-dsl-libui'
require 'chunky_png'

include Glimmer

f = File.open(File.expand_path('../icons/glimmer.png', __dir__))
canvas = ChunkyPNG::Canvas.from_io(f)
f.close
canvas.resample_nearest_neighbor!(24, 24)
data = canvas.to_rgba_stream
width = canvas.width
height = canvas.height
img = image {
  image_part(data, width, height, width * 4)
}

data = [
  [['cat', :red]      , ['meow', :blue]                  , [true, 'mammal', :green], [img, 'Glimmer', :dark_blue], {r: 255, g: 120, b: 0, a: 0.5}],
  [['dog', :yellow]   , ['woof', {r: 240, g: 32, b: 32}] , [true, 'mammal', :green], [img, 'Glimmer', :dark_blue], :skyblue],
  [['chicken', :beige], ['cock-a-doodle-doo', :blue]     , [false, 'mammal', :red] , [img, 'Glimmer', :beige], {r: 5, g: 120, b: 110}],
  [['horse', :purple] , ['neigh', {r: 240, g: 32, b: 32}], [true, 'mammal', :green], [img, 'Glimmer', :dark_blue], '13a1fb'],
  [['cow', :gray]     , ['moo', :blue]                   , [true, 'mammal', :green], [img, 'Glimmer', :brown], 0x12ff02]
]

window('Animals', 500, 200) {
  horizontal_box {
    table {
      text_color_column('Animal')
      text_color_column('Sound')
      checkbox_text_color_column('Description')
      image_text_color_column('GUI')
      background_color_column('Mammal')

      cell_rows data
    }
  }
}.show

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
glimmer-dsl-libui-0.11.7 examples/basic_table_color3.rb
glimmer-dsl-libui-0.11.6 examples/basic_table_color3.rb
glimmer-dsl-libui-0.11.5 examples/basic_table_color3.rb
glimmer-dsl-libui-0.11.4 examples/basic_table_color3.rb
glimmer-dsl-libui-0.11.3 examples/basic_table_color3.rb
glimmer-dsl-libui-0.11.2 examples/basic_table_color3.rb
glimmer-dsl-libui-0.11.1 examples/basic_table_color3.rb
glimmer-dsl-libui-0.11.0 examples/basic_table_color3.rb
glimmer-dsl-libui-0.10.2 examples/basic_table_color3.rb
glimmer-dsl-libui-0.10.1 examples/basic_table_color3.rb
glimmer-dsl-libui-0.10.0 examples/basic_table_color3.rb
glimmer-dsl-libui-0.9.7 examples/basic_table_color3.rb
glimmer-dsl-libui-0.9.6 examples/basic_table_color3.rb
glimmer-dsl-libui-0.9.5 examples/basic_table_color3.rb
glimmer-dsl-libui-0.9.4 examples/basic_table_color3.rb
glimmer-dsl-libui-0.9.3 examples/basic_table_color3.rb
glimmer-dsl-libui-0.9.2 examples/basic_table_color3.rb
glimmer-dsl-libui-0.9.1 examples/basic_table_color3.rb
glimmer-dsl-libui-0.9.0 examples/basic_table_color3.rb
glimmer-dsl-libui-0.8.0 examples/basic_table_color3.rb