Skip to content

Commit 3792616

Browse files
committed
small fix on color coercion
1 parent 7803b29 commit 3792616

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4545
* Changed `compas.geometry.curves.nurbs.new_nurbscurve_from_...` to `nurbscurve_from_...`.
4646
* Changed `compas.geometry.curves.nurbs.NurbsCurve.__new__` to prevent instantiation of `NurbsCurve` directly.
4747
* Changed `compas_rhino.geometry.curves.new_nurbscurve_from_...` to `nurbscurve_from_...`.
48+
* Chnaged `compas.colors.Color.coerce` to take color as is, if it is already aninstance of `compas.colors.Color`.
4849

4950
### Removed
5051

src/compas/colors/color.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,8 @@ def coerce(color):
582582
"""
583583
if not color:
584584
return
585+
if isinstance(color, Color):
586+
return color
585587
if Color._is_rgb255(color):
586588
return Color.from_rgb255(*list(color))
587589
if Color._is_hex(color):

0 commit comments

Comments
 (0)