summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorJonathan Tron <[email protected]>2015-07-04 11:30:42 +0200
committerJonathan Tron <[email protected]>2015-07-04 11:30:42 +0200
commit69bcb479a3a3f279a8f395e02f7191ba2bd4152d (patch)
tree57ddb123fa52320176c05b92c12b23cf650813af /lib
parent5a343241ed5ae7226ce691256118e51b44c60f87 (diff)
parenta1006751413997ff5be88bd1321859d2f5dd566c (diff)
downloadcaxlsx-69bcb479a3a3f279a8f395e02f7191ba2bd4152d.tar.gz
caxlsx-69bcb479a3a3f279a8f395e02f7191ba2bd4152d.zip
Merge branch 'worksheet_tab_colour' of https://github.com/shifakhan/axlsx into shifakhan-worksheet_tab_colour
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx/workbook/worksheet/sheet_pr.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/axlsx/workbook/worksheet/sheet_pr.rb b/lib/axlsx/workbook/worksheet/sheet_pr.rb
index f271419b..e0056770 100644
--- a/lib/axlsx/workbook/worksheet/sheet_pr.rb
+++ b/lib/axlsx/workbook/worksheet/sheet_pr.rb
@@ -40,12 +40,17 @@ module Axlsx
# @return [Worksheet]
attr_reader :worksheet
+ # The tab color of the sheet.
+ # @return [Color]
+ attr_reader :tab_color
+
# Serialize the object
# @param [String] str serialized output will be appended to this object if provided.
# @return [String]
def to_xml_string(str = '')
update_properties
str << "<sheetPr #{serialized_attributes}>"
+ tab_color.to_xml_string(str, 'tabColor') if tab_color
page_setup_pr.to_xml_string(str)
str << "</sheetPr>"
end
@@ -56,6 +61,11 @@ module Axlsx
@page_setup_pr ||= PageSetUpPr.new
end
+ # @see tab_color
+ def tab_color=(v)
+ @tab_color ||= Color.new(:rgb => v)
+ end
+
private
def update_properties