Auto Calculate RGB color using cell references R G B values

Discuss the spreadsheet application

Auto Calculate RGB color using cell references R G B values

Postby IsabelDalhousie » Fri Dec 07, 2018 9:29 pm

Hello All ... I'm trying to create a spreadsheet showing a list of custom RGB colors in the cell backgrounds. I've figured out I can do this by manually creating each new RGB value in the color pallet - then applying it. BUT my challenge is I have many to create and I feel this should be possible (and more transparent for editing ) by simply listing the R, G, B values in separate cells and then asking OO to use these references to go fetch the RGB cell background color and apply it. Can anyone give me guidance on how to get there easily? Thanks in advance,

Isabel
Apache OpenOffice 4.1.5 running on macOS High Sierra 10.13.6 Arizona time zone
User avatar
IsabelDalhousie
 
Posts: 16
Joined: Thu Aug 10, 2017 2:12 am

Re: Auto Calculate RGB color using cell references R G B val

Postby Villeroy » Fri Dec 07, 2018 10:06 pm

download/file.php?id=14875 includes a macro on Module2 which generates styles from a cell range selection.

Copy Module2 to your document or to the global name space ("My Macros")
Create a user-defined cell style. In the example document it is style "Black" according to the constant cParent="Black" on Module2.
Select 2 columns of cells where the first column contains style names and the second contains integer numbers derived from RGB hexadecimals.
Call the "Main" routine.
Another macro "cleanUpStyles" deletes all styles below the parent style keeping all the other styles which have nothing to do with that macro.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 27090
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Auto Calculate RGB color using cell references R G B val

Postby IsabelDalhousie » Sat Dec 08, 2018 1:37 am

Villeroy thank you for your speedy reply. I downloaded the file and confess I'm a little intimidated by the challenge .... but the plot thickens ....

I started by validating what I thought I had already done yesterday - create some new RGB names and colors to add to the basic pallet using open office/preferences/colors ... while doing this I discovered that what I created last night was not stable ... in other words I had created a name and RGB using the drop down and thought I had saved it ... but when I go back in the RGB codes for that name have changed!! There's something that's not intuitive about how to create new colors so since I can't risk the results being incorrect I'm going to abandon this project for now .... I hope I haven't put off other users who may come across this. I may come back to it later. Thanks for your support Villeroy .. happy holidays
Apache OpenOffice 4.1.5 running on macOS High Sierra 10.13.6 Arizona time zone
User avatar
IsabelDalhousie
 
Posts: 16
Joined: Thu Aug 10, 2017 2:12 am

Re: Auto Calculate RGB color using cell references R G B val

Postby John_Ha » Sat Dec 08, 2018 2:00 am

AOO 4.1.6, Windows 7 Home 64 bit

See the Writer Manual, the Writer FAQ, the Writer Tutorials and the Writer guide.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
John_Ha
Volunteer
 
Posts: 6766
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Auto Calculate RGB color using cell references R G B val

Postby IsabelDalhousie » Sat Dec 08, 2018 2:34 am

Thanks John, this is helpful as a resource and at least puts my problems in perspective - I only have to manage less than 100 colors!
Apache OpenOffice 4.1.5 running on macOS High Sierra 10.13.6 Arizona time zone
User avatar
IsabelDalhousie
 
Posts: 16
Joined: Thu Aug 10, 2017 2:12 am


Return to Calc

Who is online

Users browsing this forum: No registered users and 14 guests