Sha256: ab5088c5a54e4ca4f5aff7de834c4f0e042797276d8cfcfb8bc9828fd27f1e28

Contents?: true

Size: 541 Bytes

Versions: 16

Compression:

Stored size: 541 Bytes

Contents

require_relative 'helpers/example_window'

class ExampleState < Fidgit::GuiState
  def initialize
    super

    vertical do
      my_label = label "No color selected."

      group do
        grid num_columns: 15, padding: 0, spacing: 4 do
          150.times do
            color_well(color: Gosu::Color.rgb(rand(255), rand(255), rand(255)))
          end
        end

        subscribe :changed do |sender, color|
          my_label.text = color.to_s
        end
      end
    end
  end
end

ExampleWindow.new.show

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
fidgit-0.2.4 examples/color_well_example.rb
fidgit-0.2.3 examples/color_well_example.rb
fidgit-0.2.2 examples/color_well_example.rb
fidgit-0.2.1 examples/color_well_example.rb
fidgit-0.2.0 examples/color_well_example.rb
fidgit-0.1.10 examples/color_well_example.rb
fidgit-0.1.9 examples/color_well_example.rb
fidgit-0.1.8 examples/color_well_example.rb
fidgit-0.1.7 examples/color_well_example.rb
fidgit-0.1.6 examples/color_well_example.rb
fidgit-0.1.5 examples/color_well_example.rb
fidgit-0.1.4 examples/color_well_example.rb
fidgit-0.1.3 examples/color_well_example.rb
fidgit-0.1.2 examples/color_well_example.rb
fidgit-0.1.1 examples/color_well_example.rb
fidgit-0.1.0 examples/color_well_example.rb