浏览代码

[+] Decode ColorProfile to RGB

Azalea (on HyDEV-Daisy) 3 年之前
父节点
当前提交
a2c8e99f39
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      hyfetch/presets.py

+ 10 - 0
hyfetch/presets.py

@@ -1,8 +1,18 @@
 from dataclasses import dataclass
 from typing import Literal
 
+from .color_util import RGB
+
 
 @dataclass
 class ColorProfile:
     colors: list[str]
     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]