From a2c8e99f39bcb79b3c0aced4b18ed950c0e82291 Mon Sep 17 00:00:00 2001 From: "Azalea (on HyDEV-Daisy)" Date: Sun, 10 Apr 2022 03:19:01 -0400 Subject: [PATCH] [+] Decode ColorProfile to RGB --- hyfetch/presets.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hyfetch/presets.py b/hyfetch/presets.py index 0f4965e2..1bbdcf03 100644 --- a/hyfetch/presets.py +++ b/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]