- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Change cell color using color values in cell
I have a column with different hex color codes and I would like to color each individual cell with the color of that cell's hex code. Is this possible?
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Change cell color using color values in cell
Here is the basic structure to use.....I don't know the specifics of your hex column so you will have to do that work.
dt:target col refers to the column name of the cells you want colored
names default to here(1);
dt=current data table();
for(i=1,i<=nrows(dt),i++,
r = hex value converted to decimal;
g = hex value converted to decimal;
b = hex value converted to decimal;
dt:target col << color cells( rgb color( r, g, b ), i );
);
The various functions are all documented in the Scripting Index under the Help pull down menu
Jim
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Change cell color using color values in cell
I am assuming the hex values are relatable to RGB values?
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Change cell color using color values in cell
Yes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Change cell color using color values in cell
I found another community post on how to change them to RGB but really what I don't know how to do is then change the cell color using the value/code in that cell.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Change cell color using color values in cell
Here is the basic structure to use.....I don't know the specifics of your hex column so you will have to do that work.
dt:target col refers to the column name of the cells you want colored
names default to here(1);
dt=current data table();
for(i=1,i<=nrows(dt),i++,
r = hex value converted to decimal;
g = hex value converted to decimal;
b = hex value converted to decimal;
dt:target col << color cells( rgb color( r, g, b ), i );
);
The various functions are all documented in the Scripting Index under the Help pull down menu
Jim