Visio Guy

Visio Discussions => General Visio => Topic started by: Yacine on January 13, 2022, 08:54:59 PM

Title: Colour palettes
Post by: Yacine on January 13, 2022, 08:54:59 PM
I was using integer numbers for assigning colours to shapes. A nice one happened to be color #121 - a pale yellow.
So fine so good, but switching to another document, I find out that here the colours are limited to 24.
Some google hours later I found about colors and color objects in Visio's object model, but no methods to interact with them. Not via GUI and not via VBA.


I enclose both documents (which I stripped off my internal data, leaving only the stuff that seems to matter).


In both documents I put a shape that has a "row_1" property as number and uses it as FillForegnd.
And it increases this prop every time it is duplicated. It does also show the property in its text.


Doc #1 is limited to 24 colors, #2 has well over 100.


Both documents were created by myself from scratch, but I can't tell what I made differently to get more colours in the second one.


Any idea?
Title: Re: Colour palettes
Post by: vojo on January 14, 2022, 01:18:22 AM
can do RGB and HSU in spreadsheet to give more color control, if you want

for example, purple could be RGB(50,0,50)
Title: Re: Colour palettes
Post by: wapperdude on January 14, 2022, 03:03:48 AM
Using the color palette is probably the least favorable technique.  It's not user editable/definable.  It's not consistent across computing platforms if memory serves correctly.

Try searching the forum...
Title: Re: Colour palettes
Post by: Yacine on January 14, 2022, 10:27:42 AM
Thank you Vojo and Wapperdude,
I am well aware of the HSL and RGB functions and I actually used them after having got stuck with numbers.
The matter is that I that I use these colors in quite big "state" matrices, where I colorize the drawing differently depending on states. Using simple numbers requires less storage space and is more readable.

The actual purpose of this post is however about how to get control over palettes, to overcome Wapperdudes correct answer about them being unreliable.
What are the right tools/handles to master palettes?
Title: Re: Colour palettes
Post by: wapperdude on January 14, 2022, 04:21:37 PM
Might you be able to make your own list with index?  Not as convenient. 

Also, I think it was John Gold smith who created a color picker...so perhaps you could use that somehow to choose desired color from a "color display"?  Neither option sounds terribly great.
Title: Re: Colour palettes
Post by: vojo on January 14, 2022, 09:32:42 PM
might be able to put a lookup table on a background page (whatever you do, it should be in the drawing so others can use it)

Somehting like
    AAA    RGB(100,0,0)
    BBB    RGB(0,100,0)
    CCC    RGB (0,0,100)

Use handles of AAA BBB CCC to look up RGB you want

Or maybe do it algorithmically

123 = RGB (1 *100, 2 * 100, 3 *100) kind of thing
Title: Re: Colour palettes
Post by: Yacine on January 14, 2022, 10:13:43 PM
Quote from: vojo on January 14, 2022, 09:32:42 PM
might be able to put a lookup table on a background page (whatever you do, it should be in the drawing so others can use it)

Somehting like
    AAA    RGB(100,0,0)
    BBB    RGB(0,100,0)
    CCC    RGB (0,0,100)

Use handles of AAA BBB CCC to look up RGB you want

Or maybe do it algorithmically

123 = RGB (1 *100, 2 * 100, 3 *100) kind of thing

That's what is actually displayed in my first attachments.
Title: Re: Colour palettes
Post by: Yacine on January 14, 2022, 10:15:10 PM
@Wapperdude,
John's colour picker is fine, but does not help here.
Setting my own list - that's actually what I'm after.
Title: Re: Colour palettes
Post by: wapperdude on January 16, 2022, 05:55:26 AM
Here's result of my color by number shape array.  Also, file has 2 interesting links.  Note, the shapes automatically increment by 1 when dropped/copy-pasted.  You can also double click and enter a value.

Cheers.
Title: Re: Colour palettes
Post by: Surrogate on January 17, 2022, 08:40:46 AM
John Marshall used to post his designs on TechNet, but now they have been moved to his website (https://johnvisiomvp.ca/downloads/)
QuoteColours
This is an Excel file of more than 4,700 colours. It contains the name and RGB values. It is inclusive so there are duplicates but the RGB values may differ and the RGBvalues may have different names. The file also contains reference to the collection names that provided some of the colours.
(https://johnvisiomvp.files.wordpress.com/2020/06/colours.png)
There you can find a lot of excel tables with colors such as Crayola, Lego Colours, Pantone etc
Title: Re: Colour palettes
Post by: wapperdude on January 17, 2022, 07:52:52 PM
In addition, VisioGuy did a similar developemt.  Thanks to Vizisthebest for the reminder.

I've attached a file, really, this time there's a file!  The file includes links to VisioGuy's development.  Plus, there's a dumbied down version that allows you to enter a number and get a fill result.  This is merely an example of what may be done.  There is no logic between numerical entries and the corresponding colors.  But, that's part of the point... create a custom table.  The shape still allows entry from the GUI.
Title: Re: Colour palettes
Post by: Visisthebest on January 17, 2022, 08:34:53 PM
Wapperdude thank you your file works fine:
Choose Colors with Numerical Shape Data Fields.vsdx (24.77 kB)

Visio Guy's old file doesn't work but no worries this works great with your file, thank you I am very happy this works now!
Title: Re: Colour palettes
Post by: wapperdude on January 17, 2022, 10:25:01 PM
Very odd.  Wonder if there was some sort of file corruption that was causing the issue???
Title: Re: Colour palettes
Post by: Visisthebest on January 18, 2022, 10:46:59 AM
That is a possibility, maybe a file conversion issue in Visio from older to newer Visio version files that doesn't work properly.
Title: Re: Colour palettes
Post by: wapperdude on January 18, 2022, 03:47:48 PM
I did not have that particular trouble.  But my PC, and just mine, none of the others in the house, mangle downloads.  But, for the most part, if I open/execute from the web browser, all is well.  That's a whole different topic though.
Title: Re: Colour palettes
Post by: Yacine on January 22, 2022, 01:22:44 PM
Saturday morning and nothing better else to do ... thought about analysing the visio file with the many colours in depth, in order to find where they are defined ... and maybe get a possibility to edit it.
Renamed the "vsdm" into "zip" and dived into the different xml (and others) files defining this one file.
... and guess what? I didn't find the definition of the many colours.
*/$& dammit!


Would it be a small reference to a - maybe - external online reference???


Chottverdammisch!
Title: Re: Colour palettes
Post by: wapperdude on January 22, 2022, 03:50:03 PM
As "I don't get out much", a question occurs to me, are there other drawing package available that accept entering a single numerical value for color choice?  My limited exposure hasn't encountered that.  But, if so, follow-up questions are:
1) does the numbering/color definition from app to app remain consistent?
2) within a single app, is there consistency from file to file and/or " machine to machine"

I would think that repeatability is of paramount importance, and thus, if any such numerical - color equivalency exists, it must be defined from within the app itself.  I am quite amazed that Visio doesn't barf up an error for such entries.  Clearly, there's some interpretive functionality mechanism, but I don't believe that's coded into Visio itself...as witnessed by other Office apps???.  Based upon the observable results, my attempts seem to indicate there may be some rounding/truncation type conversion error going on.  That would be influenced by machine design and capability...CPU type/speed, ditto RAM, pwb layout, thermal manag, or execution race conditions???

Happy hunting!