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? There are several web sites out there that provide this capability, but all of them require the HEX values, rather than the RGB or HSL that Visio provides natively. Therefore, I have created a Visio callout shape that can be associated with a target shape to report on the values of each of its main color elements, and provides hyperlinks to automatically check the contrast ratio on WebAIM.
The colour formats that can be selected from either the Shape Data window or the right mouse menu are:
- RGB – The Red, Gren, Blue formula
- HSL – The Hue, Saturation, Luminosity formula
- HEX – The web hexadecimal format
- MAP – The Visio document color map number
This special shape is possible because of the special capabilities of the callout. It can reference the values in cells of the target shape that it is associated with. In this case, there is a list of target cells available from either the Shape Data window or from the right mouse menu:
- FillForegnd – The fill color if the Solid fill pattern
- FillBgnd – The second fill colour for non-solid pattern fills
- LineColor – The colour of the lines
- Char.Color – The text or font colour
- TextBkgnd – The optional text background colour
The Target Value Shape Data row then displays the read-only value of the selected Target Cell in the selected Color Format.
The Color Values shape also has a Shape Data or right mouse menu option to Hide Leader Line.
The shape then contains three hyperlinks that opens the WebAIM Contrast Checker:
- WebAIM (fill vs target font color) – Checks the Color Value shape fill colour vs the target shape text colour
- WebAIM (fill vs black font color) – Checks the Color Value shape fill colour vs the black text colour, which is the preferred one
- WebAIM (fill vs white font color) – Checks the Color Value shape fill colour vs the white text colour, which is the second preference if black fails
Check out WebAIMContrast Checker
There is one other hyperlink:
- Donate to bVisual – Provides the opportunity to encourage me to create more useful shapes
The Color Value shape can easily be used by simply downloading the Color Values stencil into your <documents>/My Shapes folder.
Then simply drag and drop the Color Values shape on to the shape you wish to check, or drop the shape near by and drag the yellow control handle onto the target shape.
Select the Color Format and Target Cell to read the value of, and follow one of the hyperlinks to check the compliance of the selected fill and font colour.
If your shape uses no fill, pattern fill or gradient fill, then consider having a solid text background color.
Note, that this Color Values callout shape can only read the color values of the top-most shape of a group shape, and it does not take any transparency into consideration.
A big shout-out to my friend Chris Roth, aka VisGuy, for his inspirational article : Get Web Hex Color Values from Visio Shapes