It is currently Thu Apr 25, 2024 3:25 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: defining a color with variables-SOLVED! TNX TO SAULGOODE
PostPosted: Sat Nov 22, 2014 3:10 pm  (#1) 
Offline
GimpChat Member
User avatar

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



Sorry for putting here a question that can appear very silly to scheme experts, but I'm in trouble.
For the first time I want to set FG and BG colors in a .scm script
a) NOT using constants (gimp-context-set-foreground '(22 33 44))
b) NOT using an input color parameter (gimp-context-set-foreground InColor)
c) NOT using a variable which has been previously defined with constants (gimp-context-set-foreground FgColor), where FgColor has been previously defined like (FgColor '(0 0 0)))
d) BUT using three values calculated based on certain requirements from the script itself

in details:
1) I have created three values according to certain requirements, let's call them as: RedL, GreenL, BlueL
2) after the calculation I debugged the script up to that point
(gimp-message (number->string RedL)) etc.
and saw the correct values diplayed on the error console
3) but it looks to me impossible to set foreground using something like (gimp-context-set-foreground '(RedL GreenL BlueL)) or previously assigning the complete string to a variable (set! L-col '(RedL GreenL BlueL)) and using (gimp-context-set-foreground L-col)

hence: which is the correct statement to set the color using the 3 variables?

Thanks a lot in advance

_________________
"Where am I ?"


Last edited by dinasset on Sat Nov 22, 2014 5:04 pm, 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: defining a color with variables
PostPosted: Sat Nov 22, 2014 4:47 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
dinasset wrote:
hence: which is the correct statement to set the color using the 3 variables?

(gimp-context-set-foreground (list RedL GreenL BlueL))

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Last edited by saulgoode on Sat Nov 22, 2014 8:45 pm, edited 1 time in total.

Top
 Post subject: Re: defining a color with variables
PostPosted: Sat Nov 22, 2014 5:02 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
perfect!!!
thanks a lot, Saulgoode

I didn't try it before because -in my ignorance- I tought that '(a b c) was equivalent to (list a b c), but it's evidently not! many many thanks from an almost "desperate" scripter-student

_________________
"Where am I ?"


Top
 Post subject: Re: defining a color with variables-SOLVED! TNX TO SAULGOODE
PostPosted: Sat Nov 22, 2014 6:45 pm  (#4) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
I just had the same problem in the script Extrude from Path, but thanks also to Saulgoode in this post unable to get value from list
It to was solved

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Saulgoode...

15

No new posts PhotoComix and SaulGoode

13

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



* Login  



Powered by phpBB3 © phpBB Group