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

Fix _get_value function and add corresponding test #18

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/colormap/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ def _set_blue(self, blue):
blue = property(_get_blue, _set_blue, doc="getter/setter for the blue color in RGB triplet")

def _get_value(self):
return self.hls[0]
return self.hsv[2]

def _set_value(self, value):
h, s, v = self.hsv
Expand Down
1 change: 1 addition & 0 deletions test/test_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def testColors():
assert c.rgb == (0, 0 ,1)
assert c.hex == "#0000FF"
assert_list_almost_equal( c.hsv, (0.66666666666666,1,1))
assert c.value == 1
assert_list_almost_equal(c.hls, (0.666666666666666, .5,1))
print(c)

Expand Down