It is currently Thu Mar 28, 2024 7:21 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: how to use in a script a CSS color name (solved TNX Kevin)
PostPosted: Mon Nov 24, 2014 5:40 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14801
Location: roma, italy
GIMP Version: 2.8.14
Operating System: Windows
GIMP Experience: Beginner Level



(probably this question is addressed to Saul Goode, who helped me a few days ago)
Using the color picker interactively in Gimp I saw that it is possible to select a color based on its Css name (for instance maroon)
Is it possible to reference the CSS names of colors in an .scm script?
Is there maybe a kind of service piece of code with a list of all the equivalences such that maroon is defined as '(128 0 0)?
Or can it be directly inputed as maroon in some way?
Thanks a lot

_________________
"Where am I ?"


Last edited by dinasset on Mon Nov 24, 2014 8:44 am, edited 1 time in total.

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: how to use in a script (.scm) a CSS color name
PostPosted: Mon Nov 24, 2014 8:08 am  (#2) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
(gimp-context-set-foreground "maroon")

Named colours: http://en.wikipedia.org/wiki/X11_color_names although you have to make them all lower case and remove the space characters:

(gimp-context-set-foreground "yellowgreen")

Kevin


Top
 Post subject: Re: how to use in a script (.scm) a CSS color name
PostPosted: Mon Nov 24, 2014 8:43 am  (#3) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14801
Location: roma, italy
Thanks, Kevin! Very easy indeed!
I tought I tried that way, among others, before posting, but got an error (I don't remember exactly); probably I entered the name incorrectly, maybe with uppercase, I don't remember how.
Retried now and it's OK, so thanks a lot!

_________________
"Where am I ?"


Top
 Post subject: Re: how to use in a script a CSS color name (solved TNX Kevin)
PostPosted: Mon Nov 24, 2014 11:03 am  (#4) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4726
Hmmm. Just discovered that the "HTML notation" input field in color selectors accepts CSS color names (the one for FG/BG and also the one used for the parameters in plugins).

_________________
Image


Top
 Post subject: Re: how to use in a script a CSS color name (solved TNX Kevin)
PostPosted: Mon Nov 24, 2014 11:25 am  (#5) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
I only realised you could use colour names because I read a recent bugz from Saul: https://bugzilla.gnome.org/show_bug.cgi?id=739457

Kevin


Top
 Post subject: Re: how to use in a script a CSS color name (solved TNX Kevin)
PostPosted: Mon Nov 24, 2014 5:17 pm  (#6) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
paynekj wrote:
I only realised you could use colour names because I read a recent bugz from Saul: https://bugzilla.gnome.org/show_bug.cgi?id=739457

Kevin


I knew black and white worked but i had no idea you could use named colors for anything else. Good to know. :)
Thanks guys.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) GEGL Color Light Fusion (12 blend modes for color overlay)

9

No new posts Attachment(s) Background color chanage and typed text color change

8

No new posts Attachment(s) Color does not exactly match color in GIMP 2.10 (SOLVED)

9

No new posts Color changes to last color when I touch tablet pen to tablet. HELP

2

No new posts Attachment(s) Looking for Script Coder to make Script of my VHS effect

2



* Login  



Powered by phpBB3 © phpBB Group