Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for more tabColor options and split RGB #1283 #1285

Merged
merged 1 commit into from
Jul 26, 2022

Conversation

thomascharbonnel
Copy link
Contributor

@thomascharbonnel thomascharbonnel commented Jul 25, 2022

This commit renames TabColor into TabColorRGB (but keeps an alias
for backwards compatibility), as well as adds support for more tab color
options (Theme, Indexed and Tint).

Signed-off-by: Thomas Charbonnel [email protected]

Add support for more TabColor options

Description

The following changes were made:

  • Rename TabColor into TabColorRGB
  • Add TabColorTheme as well as an enum for all its values
  • Add TabColorIndexed as well as a default const for when it is unset
  • Add TabColorTint as well as a default const for when it is unset

Related Issue

#1283

Motivation and Context

The current version of Excelize only supports TabColor of type "RGB". Excel can set tab colors based on other dimensions (see here).

How Has This Been Tested

By adding tests to the existing tests for worksheet options in sheetpr_test.go
All the tests passed on Linux (Fedora 34, go1.16.13)

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@xuri xuri added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 25, 2022
Copy link
Member

@xuri xuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR. I've left some comments.

@thomascharbonnel thomascharbonnel force-pushed the 1283-tabcolor-add-non-rgb branch from 82276b9 to 6a48997 Compare July 26, 2022 01:55
@thomascharbonnel
Copy link
Contributor Author

Regarding the documentation, i'm not sure if it's updated automatically when i changed the example tests, is that enough?

@thomascharbonnel thomascharbonnel marked this pull request as ready for review July 26, 2022 01:56
@xuri
Copy link
Member

xuri commented Jul 26, 2022

Regarding the documentation, i'm not sure if it's updated automatically when i changed the example tests, is that enough?

Yes, the example code will be verified by running them as tests.

@thomascharbonnel thomascharbonnel force-pushed the 1283-tabcolor-add-non-rgb branch 3 times, most recently from 1dff95c to 3902a13 Compare July 26, 2022 03:01
This commit renames `TabColor` into `TabColorRGB` (but keeps an alias
for backwards compatibility), as well as adds support for more tab color
  options (Theme, Indexed and Tint).

Signed-off-by: Thomas Charbonnel <[email protected]>
@thomascharbonnel thomascharbonnel force-pushed the 1283-tabcolor-add-non-rgb branch from 3902a13 to 2cfc0e0 Compare July 26, 2022 03:03
@codecov-commenter
Copy link

codecov-commenter commented Jul 26, 2022

Codecov Report

Merging #1285 (2cfc0e0) into master (ebea684) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1285   +/-   ##
=======================================
  Coverage   98.47%   98.47%           
=======================================
  Files          31       31           
  Lines       23417    23450   +33     
=======================================
+ Hits        23059    23092   +33     
  Misses        239      239           
  Partials      119      119           
Flag Coverage Δ
unittests 98.47% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sheetpr.go 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us.

@xuri xuri merged commit fd0eb2b into qax-os:master Jul 26, 2022
@xuri
Copy link
Member

xuri commented Jul 26, 2022

LGTM, thanks for your contribution.

xuri added a commit that referenced this pull request Aug 6, 2022
Using `ColorMappingType` color transformation types enumeration for tab color index, ref #1285
@xuri
Copy link
Member

xuri commented Aug 6, 2022

I have added a new exported ColorMappingType used for color transformation, using it instead of integer data type theme color enumeration, and using the ColorMappingType prefix instead of the enumeration with TabColorTheme, because these enumerations not only can be used for the tab theme color, which also can be used for the drawing markup language and themes, so I think we should rename them.

@thomascharbonnel
Copy link
Contributor Author

thomascharbonnel commented Aug 6, 2022 via email

xuri added a commit to carbin-gun/excelize that referenced this pull request Oct 9, 2022
Using `ColorMappingType` color transformation types enumeration for tab color index, ref qax-os#1285
xuri added a commit to JDavidVR/excelize that referenced this pull request Jul 11, 2023
Using `ColorMappingType` color transformation types enumeration for tab color index, ref qax-os#1285
jenbonzhang pushed a commit to jenbonzhang/excelize that referenced this pull request Oct 22, 2023
Using `ColorMappingType` color transformation types enumeration for tab color index, ref qax-os#1285
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants