OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How do I get the theme color in python-pptx?

  • Thread starter Thread starter wonton
  • Start date Start date
W

wonton

Guest
Simply put, I want to get an RGB value from a ColorFormat object, ie presentation.slides[0].shapes[0].text_frame.paragraphs.runs[0].color.

If color.type == MSO_COLOR_TYPE.SCHEME then it means the color is based off one of the slide deck's preset color schemes.

Attempting to do color.rgb yields

AttributeError: no .rgb property on color type '_SchemeColor'

I want to get the RGB for a ColorFormat of type SCHEME.
<p>Simply put, I want to get an RGB value from a <code>ColorFormat</code> object, ie <code>presentation.slides[0].shapes[0].text_frame.paragraphs.runs[0].color</code>.</p>
<p>If <code>color.type == MSO_COLOR_TYPE.SCHEME</code> then it means the color is based off one of the slide deck's preset color schemes.</p>
<p>Attempting to do <code>color.rgb</code> yields</p>
<blockquote>
<p>AttributeError: no .rgb property on color type '_SchemeColor'</p>
</blockquote>
<p>I want to get the RGB for a <code>ColorFormat</code> of type <code>SCHEME</code>.</p>
 

Latest posts

Top