Dynamic Background Color
Have you ever wanted to have a little different background color for each document in a database? Maybe based on a certain document status you would want to change the background color. There's a reserved Notes field called $PaperColor which can be used to set the background color on an individual document.First, set up a keyword field that has all the possible background colors. The formula choices for the keyword field are:
"black" : "white" : "red" : "green" : "blue" : "magenta" : "yellow" : "cyan" : "dark red" : "dark green" : "dark blue" : "dark magenta" : "dark yellow" : "dark cyan" : "gray" : "light gray" : "white" : "vanilla" : "parchment" : "ivory" : "pale green" : "sea mist" : "ice blue" : "powder blue" : "arctic blue" : "lilac mist" : "purple wash" : "violet frost" : "seashell" : "rose pearl" : "pale cherry" : "white" : "blush" : "sand" : "light yellow" : "honeydew" : "celery" : "pale aqua" : "pale blue" : "crystal blue" : "light cornflower" : "pale lavender" : "grape fizz" : "pale plum" : "pale pink" : "pale rose" : "rose quartz" : "5% gray" : "red sand" : "buff" : "lemon" : "pale lemon lime" : "mint green" : "pastel green" : "pastel blue" : "sapphire" : "cornflower" : "light lavender" : "pale purple" : "light orchid" : "pink orchid" : "apple blossom" : "pink coral" : "10% gray" : "light salmon" : "light peach" : "yellow" : "avocado" : "leaf green" : "light aqua" : "light turquoise" : "light cerulean" : "azure" : "lavender" : "light purple" : "dusty violet" : "pink" : "pastel pink" : "pastel red" : "15% gray" : "salmon" : "peach" : "mustard" : "lemon lime" : "neon green" : "aqua" : "turquoise" : "cerulean" : "wedgewood" : "heather" : "purple haze" : "orchid" : "flamingo" : "cherry pink" : "red coral" : "20% gray" : "dark salmon" : "dark peach" : "gold" : "yellow green" : "light green" : "caribbean" : "dark pastel blue" : "dark cerulean" : "manganese blue" : "lilac" : "purple" : "light red violet" : "light magenta" : "rose" : "carnation pink" : "25% gray" : "watermelon" : "tangerine" : "orange" : "chartreuse" : "green" : "teal" : "dark turquoise" : "light slate blue" : "medium blue" : "dark lilac" : "royal purple" : "fuchsia" : "confetti pink" : "pale burgundy" : "strawberry" : "30% gray" : "rouge" : "burnt orange" : "dark orange" : "light olive" : "kelly green" : "sea green" : "aztec blue" : "dusty blue" : "blueberry" : "violet" : "deep purple" : "red violet" : "hot pink" : "dark rose" : "poppy red" : "35% gray" : "crimson" : "red" : "light brown" : "olive" : "dark green" : "dark teal" : "spruce" : "slate blue" : "navy blue" : "blue violet" : "amethyst" : "dark red violet" : "magenta" : "light burgundy" : "cherry red" : "40% gray" : "dark crimson" : "dark red" : "hazelnut" : "dark olive" : "emerald" : "malachite" : "dark spruce" : "steel blue" : "blue" : "iris" : "grape" : "plum" : "dark magenta" : "burgundy" : "cranberry" : "50% gray" : "mahogany" : "brick" : "dark brown" : "deep olive" : "dark emerald" : "evergreen" : "baltic blue" : "blue denim" : "cobalt blue" : "dark iris" : "midnight" : "dark plum" : "plum red" : "dark burgundy" : "scarlet" : "60% gray" : "chestnut" : "terra cotta" : "umber" : "amazon" : "peacock green" : "pine" : "seal blue" : "dark slate blue" : "royal blue" : "lapis" : "dark grape" : "aubergine" : "dark plum red" : "raspberry" : "deep scarlet" : "70% gray" : "red gray" : "tan" : "khaki" : "putty" : "bamboo green" : "green gray" : "baltic gray" : "blue gray" : "rain cloud" : "lilac gray" : "light purple gray" : "light mauve" : "light plum gray" : "light burgundy gray" : "rose gray" : "80% gray" : "dark red gray" : "dark tan" : "safari" : "olive gray" : "jade" : "dark green gray" : "spruce gray" : "dark blue gray" : "atlantic gray" : "dark lilac gray" : "purple gray" : "mauve" : "plum gray" : "burgundy gray" : "dark rose gray" : "black"
Then add a hidden, computed field called $PaperColor (this must be the exact name) to your document. Here's the formula for that field:
@Member(BgColor; "black" : "white" : "red" : "green" : "blue" : "magenta" : "yellow" : "cyan" : "dark red" : "dark green" : "dark blue" : "dark magenta" : "dark yellow" : "dark cyan" : "gray" : "light gray" : "white" : "vanilla" : "parchment" : "ivory" : "pale green" : "sea mist" : "ice blue" : "powder blue" : "arctic blue" : "lilac mist" : "purple wash" : "violet frost" : "seashell" : "rose pearl" : "pale cherry" : "white" : "blush" : "sand" : "light yellow" : "honeydew" : "celery" : "pale aqua" : "pale blue" : "crystal blue" : "light cornflower" : "pale lavender" : "grape fizz" : "pale plum" : "pale pink" : "pale rose" : "rose quartz" : "5% gray" : "red sand" : "buff" : "lemon" : "pale lemon lime" : "mint green" : "pastel green" : "pastel blue" : "sapphire" : "cornflower" : "light lavender" : "pale purple" : "light orchid" : "pink orchid" : "apple blossom" : "pink coral" : "10% gray" : "light salmon" : "light peach" : "yellow" : "avocado" : "leaf green" : "light aqua" : "light turquoise" : "light cerulean" : "azure" : "lavender" : "light purple" : "dusty violet" : "pink" : "pastel pink" : "pastel red" : "15% gray" : "salmon" : "peach" : "mustard" : "lemon lime" : "neon green" : "aqua" : "turquoise" : "cerulean" : "wedgewood" : "heather" : "purple haze" : "orchid" : "flamingo" : "cherry pink" : "red coral" : "20% gray" : "dark salmon" : "dark peach" : "gold" : "yellow green" : "light green" : "caribbean" : "dark pastel blue" : "dark cerulean" : "manganese blue" : "lilac" : "purple" : "light red violet" : "light magenta" : "rose" : "carnation pink" : "25% gray" : "watermelon" : "tangerine" : "orange" : "chartreuse" : "green" : "teal" : "dark turquoise" : "light slate blue" : "medium blue" : "dark lilac" : "royal purple" : "fuchsia" : "confetti pink" : "pale burgundy" : "strawberry" : "30% gray" : "rouge" : "burnt orange" : "dark orange" : "light olive" : "kelly green" : "sea green" : "aztec blue" : "dusty blue" : "blueberry" : "violet" : "deep purple" : "red violet" : "hot pink" : "dark rose" : "poppy red" : "35% gray" : "crimson" : "red" : "light brown" : "olive" : "dark green" : "dark teal" : "spruce" : "slate blue" : "navy blue" : "blue violet" : "amethyst" : "dark red violet" : "magenta" : "light burgundy" : "cherry red" : "40% gray" : "dark crimson" : "dark red" : "hazelnut" : "dark olive" : "emerald" : "malachite" : "dark spruce" : "steel blue" : "blue" : "iris" : "grape" : "plum" : "dark magenta" : "burgundy" : "cranberry" : "50% gray" : "mahogany" : "brick" : "dark brown" : "deep olive" : "dark emerald" : "evergreen" : "baltic blue" : "blue denim" : "cobalt blue" : "dark iris" : "midnight" : "dark plum" : "plum red" : "dark burgundy" : "scarlet" : "60% gray" : "chestnut" : "terra cotta" : "umber" : "amazon" : "peacock green" : "pine" : "seal blue" : "dark slate blue" : "royal blue" : "lapis" : "dark grape" : "aubergine" : "dark plum red" : "raspberry" : "deep scarlet" : "70% gray" : "red gray" : "tan" : "khaki" : "putty" : "bamboo green" : "green gray" : "baltic gray" : "blue gray" : "rain cloud" : "lilac gray" : "light purple gray" : "light mauve" : "light plum gray" : "light burgundy gray" : "rose gray" : "80% gray" : "dark red gray" : "dark tan" : "safari" : "olive gray" : "jade" : "dark green gray" : "spruce gray" : "dark blue gray" : "atlantic gray" : "dark lilac gray" : "purple gray" : "mauve" : "plum gray" : "burgundy gray" : "dark rose gray" : "black") - 1
Now individual documents can have a unique background color.
Note: Page 2 of this hint lists the choices straight down a list, so you could use hard-coded values instead of the formulas.
Note: This field is recalculated only when the document opens. This means that if you change the value on a document, you won't see the change until the document is closed and re-opened.
Note: DO NOT CHANGE THE FORMULA FOR $PAPERCOLOR. You can get rid of some of the keyword choices if you want (e.g., you may not want to have "black" as a background option if you have black text) but $PaperColor shouldn't be changed. $PaperColor actually stores a number value and that number value is what's used for the background color. So the formula is very important so that the correct number can be stored in the document. You don't need to go through all the translation if you know what number to put into $PaperColor, but we prefer this method (you can actually associate a name with the color).
Note: This functionality works better on the web than through Notes, and works better through Notes if the field is stored as part of the document (and therefore is changed programatically).
10% gray
15% gray
20% gray
25% gray
30% gray
35% gray
40% gray
50% gray
5% gray
60% gray
70% gray
80% gray
amazon
amethyst
apple blossom
aqua
arctic blue
atlantic gray
aubergine
avocado
aztec blue
azure
baltic blue
baltic gray
bamboo green
black
blue
blue denim
blue gray
blue violet
blueberry
blush
brick
buff
burgundy
burgundy gray
burnt orange
caribbean
carnation pink
celery
cerulean
chartreuse
cherry pink
cherry red
chestnut
cobalt blue
confetti pink
cornflower
cranberry
crimson
crystal blue
cyan
dark blue
dark blue gray
dark brown
dark burgundy
dark cerulean
dark crimson
dark cyan
dark emerald
dark grape
dark green
dark green gray
dark iris
dark lilac
dark lilac gray
dark magenta
dark olive
dark orange
dark pastel blue
dark peach
dark plum
dark plum red
dark red
dark red gray
dark red violet
dark rose
dark rose gray
dark salmon
dark slate blue
dark spruce
dark tan
dark teal
dark turquoise
dark yellow
deep olive
deep purple
deep scarlet
dusty blue
dusty violet
emerald
evergreen
flamingo
fuchsia
gold
grape
grape fizz
gray
green
green gray
hazelnut
heather
honeydew
hot pink
ice blue
iris
ivory
jade
kelly green
khaki
lapis
lavender
leaf green
lemon
lemon lime
light aqua
light brown
light burgundy
light burgundy gray
light cerulean
light cornflower
light gray
light green
light lavender
light magenta
light mauve
light olive
light orchid
light peach
light plum gray
light purple
light purple gray
light red violet
light salmon
light slate blue
light turquoise
light yellow
lilac
lilac gray
lilac mist
magenta
mahogany
malachite
manganese blue
mauve
medium blue
midnight
mint green
mustard
navy blue
neon green
olive
olive gray
orange
orchid
pale aqua
pale blue
pale burgundy
pale cherry
pale green
pale lavender
pale lemon lime
pale pink
pale plum
pale purple
pale rose
parchment
pastel blue
pastel green
pastel pink
pastel red
peach
peacock green
pine
pink
pink coral
pink orchid
plum
plum gray
plum red
poppy red
powder blue
purple
purple gray
purple haze
purple wash
putty
rain cloud
raspberry
red
red coral
red gray
red sand
red violet
rose
rose gray
rose pearl
rose quartz
rouge
royal blue
royal purple
safari
salmon
sand
sapphire
scarlet
sea green
sea mist
seal blue
seashell
slate blue
spruce
spruce gray
steel blue
strawberry
tan
tangerine
teal
terra cotta
turquoise
umber
vanilla
violet
violet frost
watermelon
wedgewood
white
yellow
yellow green