[+] Decode ColorProfile to RGB
This commit is contained in:
parent
2e53009c10
commit
a2c8e99f39
1 changed files with 10 additions and 0 deletions
|
@ -1,8 +1,18 @@
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Literal
|
from typing import Literal
|
||||||
|
|
||||||
|
from .color_util import RGB
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class ColorProfile:
|
class ColorProfile:
|
||||||
colors: list[str]
|
colors: list[str]
|
||||||
spacing: Literal['equal', 'weighted'] = 'equal'
|
spacing: Literal['equal', 'weighted'] = 'equal'
|
||||||
|
|
||||||
|
def decode(self) -> list[RGB]:
|
||||||
|
"""
|
||||||
|
Decode to a list of RGBs
|
||||||
|
|
||||||
|
:return: List of RGBs
|
||||||
|
"""
|
||||||
|
return [RGB.from_hex(c) for c in self.colors]
|
||||||
|
|
Loading…
Reference in a new issue