Colour palettes

Started by Yacine, January 13, 2022, 08:54:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yacine

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?
Yacine

vojo

can do RGB and HSU in spreadsheet to give more color control, if you want

for example, purple could be RGB(50,0,50)

wapperdude

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...
Visio 2019 Pro

Yacine

#3
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?
Yacine

wapperdude

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.
Visio 2019 Pro

vojo

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

Yacine

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.
Yacine

Yacine

@Wapperdude,
John's colour picker is fine, but does not help here.
Setting my own list - that's actually what I'm after.
Yacine

wapperdude

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.
Visio 2019 Pro

Surrogate

#9
John Marshall used to post his designs on TechNet, but now they have been moved to his website
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.

There you can find a lot of excel tables with colors such as Crayola, Lego Colours, Pantone etc

wapperdude

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.
Visio 2019 Pro

Visisthebest

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!
Visio 2021 Professional

wapperdude

Very odd.  Wonder if there was some sort of file corruption that was causing the issue???
Visio 2019 Pro

Visisthebest

That is a possibility, maybe a file conversion issue in Visio from older to newer Visio version files that doesn't work properly.
Visio 2021 Professional

wapperdude

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.
Visio 2019 Pro