0
$\begingroup$

I have a custom palette that already has colors inside of it. I can even select which colors I want, but they don't do anything. Although, I can print out the locations of color in memory with 'print(pal.colors.active)' where 'pal' is a 'Palette' object - how can I get the R, G, and B components of the active color within said palette? I know there are tons of questions asked on colors already. But, I couldn't seem to find another post with this specific problem relating to colors.

Thanks in advance! Any help is appreciated.

$\endgroup$
1
  • $\begingroup$ Consider expanding tags on this question. At least add python. $\endgroup$
    – int_ua
    Jul 30 '20 at 0:02
0
$\begingroup$

According to docs PaletteColor class has color attribute, which is

float array of 3 items in [0, 1], default (0.0, 0.0, 0.0)

And active is just another PaletteColor.

Assuming these values are RGB, it would be

print([value for value in pal.colors.active.color])
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.