Class: Qt::Color
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
permalink ._load(str) ⇒ Object
[View source]
302 303 304 305 |
# File 'lib/ruber/qt_sugar.rb', line 302 def self._load str r, g, b = str.split ';' self.new r.to_i, g.to_i, b.to_i end |
permalink .yaml_new(cls, tag, val) ⇒ Object
[View source]
283 284 285 286 |
# File 'lib/ruber/qt_sugar.rb', line 283 def self.yaml_new cls, tag, val r, g, b= val['red'], val['green'], val['blue'] Qt::Color.new(r, g, b) end |
Instance Method Details
permalink #_dump(_) ⇒ Object
[View source]
298 299 300 |
# File 'lib/ruber/qt_sugar.rb', line 298 def _dump _ "#{red};#{green};#{blue}" end |
permalink #to_yaml(opts = {}) ⇒ Object
[View source]
288 289 290 291 292 293 294 295 296 |
# File 'lib/ruber/qt_sugar.rb', line 288 def to_yaml opts = {} YAML.quick_emit(self, opts) do |out| out.map(taguri, to_yaml_style) do |map| map.add 'red', red map.add 'green', green map.add 'blue', blue end end end |