fangsnclaws / Main / Brio Examples

fangsnclaws.com


"We'll sink our fangs and claws into your project!"

Expanding the Brio Color Palette

{Thanks and a Hat Tip to Brian K. Scarlett [PCS] for corresponding with me and coming up with the correct solution! This one's for you, Brian!}

The Problem:
The Brio color palette, available through the 'object properties background color menu tab', can be rather limiting. Brio offers 54 standard colors, (in a 9 by 6 grid), in 4 'fill' choices; solid, 25% fill, 50% fill, and 75% fill. This gives us a total of 216 colors to design with.

While a pretty decent selection, the available colors may not 'exactly match' the client's desires. In fact, they may not allow you to have your reports conform to internally published corporate 'style guide guidelines'. That can be a problem.

The 'Work-Around':
Let's look at how we turn the value of a hex RGB color into it's decimal equivalent:

Let's start with a nice 'peach' color, #FF8C67 (*). Converting this from Hex to base 10 is fairly straightforward. Multiply the "7" by 16 to the 0 power, (which just happens to be "1"). Then multiply the "6" by 16 to the 1st power, (or "16"). Multiply the "C" by 16 to the 2nd power, (or "256"). [In hexidecimal, "A" = 10, "B" = 11, "C" = 12, "D" = 13, "E" = 14, and "F" = 15.] Continue this pattern as shown below. Now add up all the individual results to get one, usually pretty darn big, number - this is the decimal equivalant for the hexidecimal color value.

Powers of 16 (hex)1,048,57665,5364,096256161 
RGB Color (FF8C67)151581267 
* Multiply & Sum *15,728,640983,04032,7683,07296716,747,623

This decimal value can now be used in your scripts as follows: "[object].Fill.Color = 16747623"

Some of you may be thinking: "Gee, that's great Ron - but EIS section background fill colors aren't the most accessible objects to script! How do we use these fancy colors in an EIS background?"

I'd recommend "cheating".     ;-)    Change the screen resolution on your development machine ... set it to a very high resolution. (Higher than any of your users would sanely use!) Now get out your magnifying glass and add a rectangle to the blank EIS section and stretch it as large as you can. Now set the screen resolution back to a more normal value. You can easily script the fill color for your rectangle and you can set all of your user control design elements on top of the rectangle to "cheat" and use it as a surrogate for a true background color.


Hope that makes your reports more colorful ... and keeps your clients happier! [If you have a great tip like this, send it in to me. [webmaster@fangsnclaws.com] If I get around to writing it up, I'll give you credit in a "hat tip" up front!]

RonL.

(*) Yes, I am aware of the 216 "websafe" non-dithering colors. These can be generated by using any of the following values; "00", "33", "66", "99", "CC", "FF" for any of the RBG values in the hex triplet. Hence, "#003366" is 'websafe', as is "#CCFF66". Unfortunately, not all customer requirements conform to 'websafe'. I deliberately chose a non-'websafe' color for the above example to illustrate the arithmetic.

PostScript

28-MAR-2003 - Here is an improved version on my little 'Colour Picker' application to help you visualize the design for your Brio reports. The improvements include: (1) The 'decimalized' color value now appears on both a light and a dark background for better readability, (2) I've added command buttons to pop up alert boxes to show you the individual object color values once you have finalized your design, and (3) I've added a fourth object, [text placed directly on the background color], to 'colourize' and experiment with. I hope you find the improvements worthwhile! Download my tiny little 7k zip file by Clicking Here!

Here is a screenshot of what you get:
Color Picker Example