How Does borderColor Work in SMIL Transitions?

The borderColor attribute in Synchronized Multimedia Integration Language (SMIL) defines the visual color applied to the leading boundary or edge during a wipe, iris, or geometric transition effect. Used in conjunction with borderWidth, it enhances transition effects between media elements by highlighting the moving demarcation line where the incoming visual stream replaces the outgoing one. This attribute supports standard color representations, allowing developers and designers to create stylized, branded, or visually distinct transition borders rather than default hard cuts.

The Role and Function of borderColor in SMIL

In the SMIL Transitions module, visual transitions—such as wipes, fades, slides, and expands—are defined using transition elements like <transition> or <transitionFilter>. When a transition involves geometric movement across a visual plane, the engine calculates a moving boundary between the previous state and the new state.

The borderColor attribute explicitly targets this transition boundary:

Supported Color Formats

SMIL specifications align with standard web color models for the borderColor attribute. Accepted formats include:

If an invalid color value is provided, SMIL user agents typically fall back to the default implementation color, which is standard black (#000000).

Practical Implementation Example

Transitions in SMIL are declared either within the <head> of the document or attached directly to media elements within the <body>.

<smil xmlns="http://www.w3.org/ns/SMIL" version="3.0" baseProfile="Language">
  <head>
    <layout>
      <root-layout width="640" height="480" />
      <region id="main_region" width="640" height="480" />
    </layout>
    <transition id="wipeRightWithGoldBorder" 
                type="barWipe" 
                subtype="leftToRight" 
                dur="2s" 
                borderWidth="4" 
                borderColor="#FFD700" />
  </head>
  <body>
    <seq>
      <img src="intro.jpg" dur="5s" region="main_region" />
      <img src="feature.jpg" dur="5s" region="main_region" transIn="wipeRightWithGoldBorder" />
    </seq>
  </body>
</smil>

In this implementation, as feature.jpg replaces intro.jpg over two seconds from left to right, a solid gold line four units wide sweeps across the canvas, clearly framing the arrival of the new visual media.

Key Considerations and Best Practices