It is currently Thu Jun 25, 2026 5:58 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Change foreground and background color
PostPosted: Fri Apr 10, 2020 1:59 pm  (#1) 
Offline
New Member

Joined: Apr 10, 2020
Posts: 2
Hey guys,
Im trying to finish a plugin for gimp and im having a hard time figuring out how to simply set the foreground and background color as the first step. any help would be appreciated. Im trying to set the foreground to 64%k and the background to 12%k
Thank You


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Change foreground and background color
PostPosted: Fri Apr 10, 2020 7:32 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
In python, se the gimpcolor module:

import gimpcolor

purple=gimpcolor.RGB(255,0,255)  # as 0..255 integers
purple=gimpcolor.RGB(1.,0.,1.)  # as 0...1. floats


Try "import gimpcolor;help(gimpcolor)" in the Python-fu console for more information.

_________________
Image


Top
 Post subject: Re: Change foreground and background color
PostPosted: Fri Apr 10, 2020 8:29 pm  (#3) 
Offline
New Member

Joined: Apr 10, 2020
Posts: 2
Thank you!!


Top
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group