@@ -555,23 +555,23 @@ def _clamp_rgb_coordinate(self, coord):
555
555
@property
556
556
def clamped_rgb_r (self ):
557
557
"""
558
- The clamped (0-1 or 1-255 ) R value.
558
+ The clamped (0.0-1.0 ) R value.
559
559
"""
560
560
561
561
return self ._clamp_rgb_coordinate (self .rgb_r )
562
562
563
563
@property
564
564
def clamped_rgb_g (self ):
565
565
"""
566
- The clamped (0-1 or 1-255 ) G value.
566
+ The clamped (0.0-1.0 ) G value.
567
567
"""
568
568
569
569
return self ._clamp_rgb_coordinate (self .rgb_g )
570
570
571
571
@property
572
572
def clamped_rgb_b (self ):
573
573
"""
574
- The clamped (0-1 or 1-255 ) B value.
574
+ The clamped (0.0-1.0 ) B value.
575
575
"""
576
576
577
577
return self ._clamp_rgb_coordinate (self .rgb_b )
@@ -581,9 +581,6 @@ def get_upscaled_value_tuple(self):
581
581
Scales an RGB color object from decimal 0.0-1.0 to int 0-255.
582
582
"""
583
583
584
- if self .is_upscaled :
585
- return self .get_value_tuple ()
586
-
587
584
# Scale up to 0-255 values.
588
585
rgb_r = int (math .floor (0.5 + self .rgb_r * 255 ))
589
586
rgb_g = int (math .floor (0.5 + self .rgb_g * 255 ))
@@ -625,6 +622,10 @@ class sRGBColor(BaseRGBColor):
625
622
"""
626
623
Represents an sRGB color.
627
624
625
+ .. note:: If you pass in upscaled values, we automatically scale them
626
+ down to 0.0-1.0. If you need the old upscaled values, you can
627
+ retrieve them with :py:meth:`get_upscaled_value_tuple`.
628
+
628
629
:ivar float rgb_r: R coordinate
629
630
:ivar float rgb_g: G coordinate
630
631
:ivar float rgb_b: B coordinate
@@ -654,6 +655,10 @@ class AdobeRGBColor(BaseRGBColor):
654
655
"""
655
656
Represents an Adobe RGB color.
656
657
658
+ .. note:: If you pass in upscaled values, we automatically scale them
659
+ down to 0.0-1.0. If you need the old upscaled values, you can
660
+ retrieve them with :py:meth:`get_upscaled_value_tuple`.
661
+
657
662
:ivar float rgb_r: R coordinate
658
663
:ivar float rgb_g: G coordinate
659
664
:ivar float rgb_b: B coordinate
0 commit comments