There are times that I have been caught out by assuming that everyone speaks “proper” English, like what I do (sic), and forgetting that there are other languages with their own formatting conventions. I think most of the world is bemused at the USA date format where they put the month before the day and the year. So illogical to everyone else, and I can’t help thinking that it was done on purpose just to catch us Brits out, like when they decided to drive on the wrong side of the road just to make it more difficult to sell cars across the border. It seems that some parts of Visio get confused if I enter the dates in the correct “dd/mm/yyyy” format, so I now type dates in the “d mmm yyyy” format in the Shape Data window calendar control because, at least, that always works. Also Visio‘s internal units are inches, and every time I see it referred to as US Units, rather than the Imperial Units that I grew up with, makes me think “so, this is what it has come to!”.
So today I was embarrassed by a Norwegian client because I forgot (again) to take extra care when using the RGB(…) function. The result was that the displayed colours were appearing black in Norwegian (and doubtless many other languages), but correctly grey (gray if you are in the USA), blue, green and yellow in English (both UK and US).
If you examine the images above, you will see that the User-defined Cells for each named colour are displaying the RGB function with the numbers separated by a comma. That much is correct, but the User.Color value is 181, which is only the second number of the User.CenikaLayoutColorGray value, RGB(177,181, 190). So, what is happening?
Firstly, the number 181 is way above any value of the index of the 24 default colours available to the FillForegnd cell, so it displays as black. Secondly, it is splitting the values on the commas, so I need to explain why.
The user selects in the fixed-list Prop.Type Shape Data row. The choices are stored as semi-colon separated values in the Prop.Type.Format cell (Grey;Blue;Yellow/Green):
The default list separator for Visio is the semi-colon, and the default formula in the Prop.Type.Value cell updated by the selection in the drop-down is:
where n is inclusively between 0 and 2.
The User.TypeIdx cell has a formula:
This correctly returns a value between 0 and 2, which is then used to get the corresponding RGB value in the User.Color cell:
This is a construct that I do frequently, but it ignores the fact that many languages use the semi-colon as a list separator.
To test this, I only need to change the Settings / Regional Format to a suitable non-English language, like Norwegian.
Then I can test the effect it has on this formula in Visio. The answer is to use any suitable character, such as the pipe character, to separate the individual colours in the list, and then specify that character in the optional third parameter of the INDEX(…) function:
which evaluates to:
So now everything looks ok, and the value of the User.Color cell displays with semi-colon separators in Norwegian, but with comma separators in English:
Notice how the values of the named color rows still display with comma separators above. This is because these rows are not string values, but the User.Color value is a string that is evaluated.
So now the user can select the colour choice in the Shape Data window, and everything displays correctly, regardless of the language.
All I need to do now is to remember this next time!
The Web Content Access Guidelines (WCAG) 2.0 provides the current recommendations for making web content accessible to users with vision impairment, but how do you test if your Visio shapes pass?
Learn how to format SharePoint list columns with RGB values
Learn how to write a ShapeSheet formula to ensure high contrast of text on a shape background fill for visibility accessibility
I was recently exploring the ShapeSheet formulas available in Visio that affect colors, and I decided that I needed to make a shape that I can change the fill color, tint, shade and tone of dynamically. This allows me to copy the formulas from a Shape Data row value for pasting into a ShapeSheet cell.…
A few years ago, I wrote an article about displaying the RGB value of shapes ( see http://blog.bvisual.net/2010/04/22/displaying-the-rgb-values-of-shapes ). I had forgotten about it, but a reader recently asked if it was possible to force the Foregnd field to display the RGB value for the standard color palette values. For example, red is number 2…
Everyone knows that you can change the colour of Visio shapes. Most people know that you can also change the fill pattern too. (more…)