Sha256: c7b3d07b726e6abf0dbac5aac689736d63088356be66788785a5cee789998ef8

Contents?: true

Size: 616 Bytes

Versions: 6

Compression:

Stored size: 616 Bytes

Contents

class UIColor
  def uicolor ; self ; end

  def red
    _sugarcube_colors[:red]
  end

  def green
    _sugarcube_colors[:green]
  end

  def blue
    _sugarcube_colors[:blue]
  end

  def alpha
    _sugarcube_colors[:alpha]
  end

private
  def _sugarcube_colors
    @color ||= begin
      red = Pointer.new(:float)
      green = Pointer.new(:float)
      blue = Pointer.new(:float)
      alpha = Pointer.new(:float)
      self.getRed(red, green:green, blue:blue, alpha:alpha)
      @color = {
        red: red[0],
        green: green[0],
        blue: blue[0],
        alpha: alpha[0],
      }
    end
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sugarcube-0.11.3 lib/sugarcube/uicolor.rb
sugarcube-0.11.2 lib/sugarcube/uicolor.rb
sugarcube-0.11.1 lib/sugarcube/uicolor.rb
sugarcube-0.11 lib/sugarcube/uicolor.rb
sugarcube-0.10 lib/sugarcube/uicolor.rb
sugarcube-0.9.4 lib/sugarcube/uicolor.rb