Opened 10 years ago
Closed 10 years ago
#144 closed defect (fixed)
HSL colorspecs don't work
Reported by: | Elaine Meng | Owned by: | Greg Couch |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Graphics | Version: | |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Notify when closed: | Platform: | all | |
Project: | chimera |
Description
I couldn't get any hsl colorspecs to work, e.g.
color hsl(0,100,50)
color hsl(0%,100%,50%)
color hsla(0%,100%,50%,.5)
This is in the 9/1 build. If you fixed it after then, apologies.
Change History (2)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Ack. Looks like I didn't "submit changes" in my previous response. This backtrace is a different bug -- it was introduced when putting the decimal point support and is now fixed. In response to the original bug, the error reporting for bad color specifiers was improved.
The CSS3 color specification is http://www.w3.org/TR/css3-color/ and the draft CSS4 color specification is https://drafts.csswg.org/css-color/.
Now I understand that the hue value shouldn't have a %. However, they don't work without the percent sign either. "color hsl(0,100%,50%)" gives this traceback:
Traceback (most recent call last):
File "/Users/chimera/Applications/Chimera2_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/chimera/cmd_line/gui.py", line 113, in on_enter
cmd = Command(session, cmd_text, final=True)
File "/Users/chimera/Applications/Chimera2_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/chimera/core/commands/cli.py", line 1382, in init
self.parse_text(text, final=final, _used_aliases=_used_aliases)
File "/Users/chimera/Applications/Chimera2_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/chimera/core/commands/cli.py", line 1708, in parse_text
self._process_positional_arguments()
File "/Users/chimera/Applications/Chimera2_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/chimera/core/commands/cli.py", line 1592, in _process_positional_arguments
value, text = self._parse_arg(anno, text, session, False)
File "/Users/chimera/Applications/Chimera2_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/chimera/core/commands/cli.py", line 1483, in _parse_arg
value, replacement, rest = annotation.parse(text, session)
File "/Users/chimera/Applications/Chimera2_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/chimera/core/commands/cli.py", line 725, in parse
return anno.parse(text, session)
File "/Users/chimera/Applications/Chimera2_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/chimera/core/commands/colorarg.py", line 93, in parse
hue = _convert_angle(numbers[0], 'hue angle')
File "/Users/chimera/Applications/Chimera2_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/chimera/core/commands/colorarg.py", line 232, in _convert_angle
return n / 360
TypeError: unsupported operand type(s) for /: 'str' and 'int'