cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-426578%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3Een%20utilisant%20les%20valeurs%20RVB%20dans%20les%20scripts%20JSL%20au%20lieu%20du%20nom%20de%20la%20couleur%20ou%20quoi%20que%20ce%20soit%20(--16741343)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-426578%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EBonjour%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EJe%20suis%20nouveau%20dans%20l'utilisation%20d'un%20script%20JSL%20de%20base%20qui%20a%20%C3%A9t%C3%A9%20enregistr%C3%A9%20apr%C3%A8s%20la%20cr%C3%A9ation%20d'un%20graphique%20%C3%A0%20barres.%20Bien%20que%20je%20d%C3%A9finisse%20des%20valeurs%20RVB%20pour%20attribuer%20des%20couleurs%20aux%20barres%20dans%20Graph%20Builder%2C%20le%20script%20JSL%20r%C3%A9sultant%20me%20donne%20ceci%26nbsp%3B%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EProperties(%201%2C%20%7BFill%20Color(%20%22yellow%22%20)%7D%20)%2C%0AProperties(%202%2C%20%7BFill%20Color(%20-16741343%20)%7D%20)%2C%0AProperties(%203%2C%20%7BFill%20Color(%20-11075814%20)%7D%20)%2C%0AProperties(%204%2C%20%7BFill%20Color(%20-16755200%20)%7D%20)%2C%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPuis-je%20utiliser%20des%20valeurs%20RVB%20dans%20ce%20script%20%C3%A0%20la%20place%20et%20si%20oui%2C%20quelle%20est%20la%20syntaxe%26nbsp%3B%3F%20J'ai%20essay%C3%A9%20%22jaune%22%20par%20exemple%20qui%20fonctionne%20bien%2C%20mais%20%7BFill%20Color(%20255%2C255%2C0%20)%7D%20-%20le%20jaune%20que%20je%20veux%20vraiment%20-%20ne%20fonctionne%20pas.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EEst-il%20possible%20d'utiliser%20vos%20propres%20couleurs%20ou%20devez-vous%20utiliser%20la%20table%20des%20couleurs%20JMP%20%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMerci!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-426578%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CLINGO-LABEL%3EPersonnalisation%20de%20masse%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-426596%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%26nbsp%3B%3A%20utiliser%20les%20valeurs%20RVB%20dans%20les%20scripts%20JSL%20au%20lieu%20du%20nom%20de%20la%20couleur%20ou%20quoi%20que%20ce%20soit%20(--16741343)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-426596%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EMerci%20beaucoup!%20A%20parfaitement%20fonctionn%C3%A9%20!!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-426583%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%26nbsp%3B%3A%20utiliser%20les%20valeurs%20RVB%20dans%20les%20scripts%20JSL%20au%20lieu%20du%20nom%20de%20la%20couleur%20ou%20quoi%20que%20ce%20soit%20(--16741343)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-426583%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EVous%20devez%20utiliser%20la%20fonction%20RGB%20Color().%20L'index%20de%20script%20donne%20un%20bel%20exemple%20d'utilisation%20de%20la%20fonction%20RGB%20Color()%20pour%20convertir%20de%20RVB%20en%20couleur%20JMP.%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0ANew%20Window(%20%22RGB%20Color%20Example%22%2C%20%0A%2F*%201%20through%2016%20are%20good%20*%2F%20%0A%20division%20%3D%206%3B%0A%20blocks%20%3D%20division%20%2B%201%3B%0A%20ysize%20%3D%20400%20%2F%20Sqrt(%20division%20)%3B%0A%20xsize%20%3D%20ysize%20*%20blocks%3B%0A%20fract%20%3D%201%20%2F%20division%3B%0A%2F*%20100%20is%20default%20axis%20range%20*%2F%0A%20yBlockSize%20%3D%20100%20%2F%20blocks%3B%0A%20xBlockSize%20%3D%20100%20%2F%20(blocks%20*%20blocks)%3B%0A%20Graph(%0A%20%20frameSize(%20xsize%2C%20ysize%20)%2C%0A%20%20For(%20blue%20%3D%200%2C%20blue%20%26lt%3B%3D%201%2C%20blue%20%2B%3D%20fract%2C%0A%20%20%20For(%20red%20%3D%200%2C%20red%20%26lt%3B%3D%201%2C%20red%20%2B%3D%20fract%2C%0A%20%20%20%20For(%20green%20%3D%200%2C%20green%20%26lt%3B%3D%201%2C%0A%20%20%20%20%20green%20%2B%3D%20fract%2C%0A%20%20%20%20%20y%20%3D%20red%20%2F%20fract%20*%20yBlockSize%3B%0A%20%20%20%20%20x%20%3D%20green%20%2F%20fract%20*%20xBlockSize%0A%20%20%20%20%20%2Bblue%20%2F%20fract%20*%20xBlockSize%20*%20blocks%3B%0A%2F*%20here's%20the%20example%20*%2F%0A%20%20%20%20%20Fill%20Color(%0A%20%20%20%20%20%20RGB%20Color(%20red%2C%20green%2C%20blue%20)%0A%20%20%20%20%20)%3B%0A%20%20%20%20%20Rect(%0A%20%20%20%20%20%20x%2C%0A%20%20%20%20%20%20y%2C%0A%20%20%20%20%20%20x%20%2B%20xBlockSize%2C%0A%20%20%20%20%20%20y%20%2B%20yBlockSize%2C%0A%20%20%20%20%20%201%0A%20%20%20%20%20)%3B%0A%20%20%20%20)%0A%20%20%20)%0A%20%20)%0A%20)%3B%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
ReneeBay
Level II

using RGB values in JSL scripts instead of color name or whatever this (--16741343) is

Hello,

 

I'm new to using a basic JSL script that was saved after building a bar chart graphic. Although I set RGB values to assign colors to bars in Graph Builder, the resulting JSL script gives me this:

 

Properties( 1, {Fill Color( "yellow" )} ),
Properties( 2, {Fill Color( -16741343 )} ),
Properties( 3, {Fill Color( -11075814 )} ),
Properties( 4, {Fill Color( -16755200 )} ),

 

Can I use RGB values in this script instead and if so, what's the syntax? I tried "yellow" for example which works fine, but {Fill Color( 255,255,0 )} - the yellow I really want - does not.

 

Is it possible to use your own colors, or do you have to use JMPs table of colors?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: using RGB values in JSL scripts instead of color name or whatever this (--16741343) is

You need to use the RGB Color() function. The Scripting Index gives a nice example of using the RGB Color() function to convert from RGB to the JMP color,.

Names Default To Here( 1 );
New Window( "RGB Color Example", 
/* 1 through 16 are good */ 
	division = 6;
	blocks = division + 1;
	ysize = 400 / Sqrt( division );
	xsize = ysize * blocks;
	fract = 1 / division;
/* 100 is default axis range */
	yBlockSize = 100 / blocks;
	xBlockSize = 100 / (blocks * blocks);
	Graph(
		frameSize( xsize, ysize ),
		For( blue = 0, blue <= 1, blue += fract,
			For( red = 0, red <= 1, red += fract,
				For( green = 0, green <= 1,
					green += fract,
					y = red / fract * yBlockSize;
					x = green / fract * xBlockSize
					+blue / fract * xBlockSize * blocks;
/* here's the example */
					Fill Color(
						RGB Color( red, green, blue )
					);
					Rect(
						x,
						y,
						x + xBlockSize,
						y + yBlockSize,
						1
					);
				)
			)
		)
	);
);

 

Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: using RGB values in JSL scripts instead of color name or whatever this (--16741343) is

You need to use the RGB Color() function. The Scripting Index gives a nice example of using the RGB Color() function to convert from RGB to the JMP color,.

Names Default To Here( 1 );
New Window( "RGB Color Example", 
/* 1 through 16 are good */ 
	division = 6;
	blocks = division + 1;
	ysize = 400 / Sqrt( division );
	xsize = ysize * blocks;
	fract = 1 / division;
/* 100 is default axis range */
	yBlockSize = 100 / blocks;
	xBlockSize = 100 / (blocks * blocks);
	Graph(
		frameSize( xsize, ysize ),
		For( blue = 0, blue <= 1, blue += fract,
			For( red = 0, red <= 1, red += fract,
				For( green = 0, green <= 1,
					green += fract,
					y = red / fract * yBlockSize;
					x = green / fract * xBlockSize
					+blue / fract * xBlockSize * blocks;
/* here's the example */
					Fill Color(
						RGB Color( red, green, blue )
					);
					Rect(
						x,
						y,
						x + xBlockSize,
						y + yBlockSize,
						1
					);
				)
			)
		)
	);
);

 

Jim
ReneeBay
Level II

Re: using RGB values in JSL scripts instead of color name or whatever this (--16741343) is

Thanks so much! Worked perfectly!!

Recommended Articles