- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
RGB color by sript
Hello
I would like to color column "Name" and to use RGB
but recive mistake, what's wrong I did in this script?
dt = Current Data Table();
rows_to_color = dt << Get Rows Where (:"NAME" == :"NAME");
Column(dt, "NAME") << Color Cells (RGB ( 173, 255, 47 ), rows_to_color);
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: RGB color by sript
Yes you can. You can convert RGB colors to "JMP Colors" using RGB Color function. Below is an example
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
// lawngreen
Column(dt, "age") << Color Cells(RGB Color({124, 252, 0}/255));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: RGB color by sript
What are you trying to do with this comparison dt << Get Rows Where (:"NAME" == :"NAME")? Get list of all rows or something else? Also I don't think JMP has RGB named argument for Color Cells (you can get those colors, but it requires a bit more work)
https://www.jmp.com/support/help/en/17.2/#page/jmp/color-cells.shtml#ww725145
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: RGB color by sript
Hello
I mean, for example, I would like to paint the columns
and mostly, I use names of color like "Light Red"
for example, to color the column HOT
rows_to_color = dt << Get Rows Where(:"HOT" == :"HOT");
Column(dt, "HOT") << Color Cells("Light Red", rows_to_color);
But I believe I can use more shades of color, maybe like RGB code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: RGB color by sript
Yes you can. You can convert RGB colors to "JMP Colors" using RGB Color function. Below is an example
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
// lawngreen
Column(dt, "age") << Color Cells(RGB Color({124, 252, 0}/255));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: RGB color by sript
Rather than use "get rows where", might be easier to create a matrix of all row numbers.
dt = New Table( "Test Color", Add Rows( 5 ),
New Column( "Column 1", Numeric, "Continuous", Format( "Best", 12 ),
Set Values( [1, 2, 3, 4, 5] ) )
);
// Create a matrix of rows 1 to n
rows_to_color = 1::nrows(dt);
// Set the color
dt:Column 1 << color cells("Red", rows_to_color);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: RGB color by sript
You can also supply a list of RGB values instead of a name or index value.
Column(dt, "age") << Color Cells( { 1, 1, 0.8 } ); // light yellow