lib/rtf/node.rb
def shading_colour(colour)
         if block_given?
            0.upto(self.size - 1) do |x|
               row = self[x]
               0.upto(row.size - 1) do |y|
                  apply = yield row[y], x, y
                  row[y].shading_colour = colour if apply
               end
            end
         end
      end
def shading_colour(colour)
         if block_given?
            0.upto(self.size - 1) do |x|
               row = self[x]
               0.upto(row.size - 1) do |y|
                  apply = yield row[y], x, y
                  row[y].shading_colour = colour if apply
               end
            end
         end
      end
This method provides a means of assigning a shading colour to a
 selection of cells within a table. The method accepts a block that
 takes three parameters - a TableCellNode representing a cell within the
 table, an integer representing the x offset of the cell and an integer
 representing the y offset of the cell. If the block returns true then
 shading will be applied to the cell.

 ==== Parameters
 colour::  A reference to a Colour object representing the shading colour
           to be applied. Set to nil to remove shading.