Skip to content

rgb

RGBColor

Bases: Photoshop

The definition of an RGB color mode.

Source code in photoshop/api/colors/rgb.py
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
class RGBColor(Photoshop):
    """The definition of an RGB color mode."""

    object_name = "RGBColor"

    def __init__(self, parent):
        super().__init__(parent=parent)
        self.blue = self.app.blue
        self.green = self.app.green
        self.red = self.app.red

    @property
    def blue(self) -> int:
        return round(self.app.blue)

    @blue.setter
    def blue(self, value: int):
        self.app.blue = value

    @property
    def green(self) -> int:
        return round(self.app.green)

    @green.setter
    def green(self, value: int):
        self.app.green = value

    @property
    def red(self) -> int:
        return round(self.app.red)

    @red.setter
    def red(self, value: int):
        self.app.red = value

    @property
    def hexValue(self):
        return self.app.hexValue

    @hexValue.setter
    def hexValue(self, value):
        self.app.hexValue = value

    def __str__(self):
        return f"[red: {self.red}, green:{self.green},  blue:{self.blue})]"

Last update: 2024-11-17
Created: 2024-11-17