Creating Web galleries: Calling a colour directly in a gallery
I’m in the middle of a standalone flash slideshow/gallery (different than the LRB XML Flash gallery!) and came across an issue which corresponds to both galleries.
Basically to make the Flash more effective I needed to be able to change the background colour of the flash. This is defined in the flash call in the HTML normally. The OBJECT code uses param name=”bgcolor” value=”#000000″, with EMBED using bgcolor=”#000000″. So I just drop in a nonCSS variable to call the Web colour? Wrong.. Or so I found out.
If I define my variable in the galleryInfo.lrweb file
["nonCSS.flashBG"] = “#000000″,
And then call it in my HTML using either
$model.nonCSS.flashBG
or
<%= model.nonCSS.flashBG %>
I don’t get the colour appearing. I get AgColor(0,0,0,1). Now 99% of my learning coding came from looking at other galleries, but I hadn’t seen a way to do the conversion from Lightroom to Web colour (or at least noticed it!). Fortunately Andy Rahn suggested using AgColorToWebColor( nonCSS.flashBG ). Now it was a bit cryptic, because it didn’t tell me how to call it. Was it a string? or a quote? Eventually between digging and trying everything (literally), I came up with the answer.
There is probably a shorter way, but here’s what I did:
galleryInfo.lrweb: In the model section I define 2 variables:
["nonCSS.flashBG"] = “#000000″,
["nonCSS.flash.bg"] = function() return string.format( “%s”, AgColorToWebColor( nonCSS.flashBG ) ) end,
In my HTML I call nonCSS.flash.bg
OBJECT
param name=”bgcolor” value=”<%= model.nonCSS.flash.bg %>”
EMBED
bgcolor=”<%= model.nonCSS.flash.bg %>“
To give me control over colour in the Gallery itself, I define a colour chip in the colorPalette section of views:
WPGPanelUI.label_and_color_row {
bindingValue = “nonCSS.flashBG”,
title = “Flash Background Colour”,
},
Hopefully this will help some of you with getting on with creating your own galleries. I intend doing a series of posts creating galleries from scratch for Lightroom News soon. I did eventually find examples of where this is used inside the default HTML gallery, but didn’t understand what was happening with it until Andy sent me in the right direction.
Can you fix the focus on a blurry photo after the fact?
The birth of Mirrorless Cameras
The Joy Of Winning A Photo Contest
Choosing your first dSLR camera
New York City can be beautiful!
Choosing the Right Light Stand
Photojojo iPhone Telephoto Lens review — AudioCast
My week with Q
How To Become A Successful Photographer
"When the Wind Stopped" — poem with 4 photos
Tips for Textures
Butterflies in Motion
Cast aways - saving those photographic memories
One Man Show: My 25 Years With Digital Photography
Studio, Flash, & Available Light — Three Books Reviewed
Portrait styling: dangerous pairings
Adobe Photoshop CS6 Product Managers Interview Audiocast
A gift of flowers: unfold your senses
On Set of "Love & Robots" the Film
No-Brainer Setup For A Digital Photo Frame Exhibit - Part 3











Planning “National Geographic” style photo travel
Wilderness Travel 1 Rainforests – Essential Gear
Backlighting Basics
A Brief History Of Light & Photography: Part 3 of 3
A Brief History Of Light & Photography: Part 2 Of 3
What Moves You?
FIGURES IN MOTION: Decades of Evolving Personal Imagery in Photography, Part 7
Lomography Store, Austin, Texas — GALLERY
GALLERY — Up to $1,000 Reward for Cattle Rustlers
25% off on photography eBooks
eyePhone: The eBook for iPhone Photographers
Interview with Harold Davis — Closeup Maestro of Flowers & Water Drops
Interview with Steve Caplin — Photoshop Digital Artist, Commercial Illustrator, & Author
Easy technique to select, edit and sequence keywords for web
How much should you charge for a photograph?


























Comments
I’ve done that in several galleries. AgColorToWebColor is a useful thing to know. On some occasions, I’ve had to double up on nonCSS variables. On others, I’ve put the AgColorToWebColor command into my appearance settings. I think I’d originally pulled it from the code for the LR HTML Gallery.
Damn, wish I’d searched for this AgColor issue 3 hours ago – it certainly was helpful!
Post new comment