fix(color): off-by-one for INDEXED_COLORS
access
#191
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Current implimentation sets the value right from the
color
tags value, e.g<color indexed="2"
, which is already zero-indexed.umya-spreadsheet/src/structs/color.rs
Lines 212 to 215 in 3c34cb8
The
- 1
would then access the previous indexes color if it was<color indexed="1.."
, or returnNone
if it was<color indexed="0"
.The flipside to this is change is that the implimentation for
set_value
no longer needs to add 1. The tests for this have been modified for this change.I added a single test with red color "RED" in
A1
which results in an
styles.xml
with: