Changeset 286 for nodebox/branches/try-qt/nodebox/graphics/qt.py
- Timestamp:
- 12/21/07 14:11:13 (13 months ago)
- Files:
-
- 1 modified
-
nodebox/branches/try-qt/nodebox/graphics/qt.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
nodebox/branches/try-qt/nodebox/graphics/qt.py
r284 r286 584 584 def _normalize(self, v): 585 585 """Bring the color into the 0-1 scale for the current colorrange""" 586 return v / self._ctx._colorrange586 return clamp(v / self._ctx._colorrange) 587 587 588 588 def _normalizeList(self, lst): 589 589 """Bring the color into the 0-1 scale for the current colorrange""" 590 return map(lambda x: x / self._ctx._colorrange, lst)590 return map(lambda x:clamp(x / self._ctx._colorrange), lst) 591 591 592 592 color = Color 593 594 def clamp(v): 595 return max(min(v, 1.0), 0.0) 593 596 594 597 class Transform(object):
