Jump to Content

Objective HTML

Photo Frame

exp:photo_frame:color_bar

This method allows you to generate a color bar from the most occurring the colors from any photo. You may define a photo with a file path or URL.

Color Boxes

Parameters

granularity=

This parameter will change the granularity of the photo used to calculate the average photo color. A lower granularity will result in a more accurate average, but take longer to calculate. So if you are perform these calculations in a loop, then it's best to raise the granularity. The default value is 45. This parameter accepts integers.


	{exp:photo_frame:color_bar file="/some/image/path.jpg" granularity="5"}
	

file=

This parameter will allow you to define the photo file path or url. You may define the photo file path or url in two ways. 1 using the file parameter, and the other using the tag data.

Example 1


	{exp:photo_frame:color_bar file="http://example.org/some/image/path.jpg"}
	

Example 2


{exp:photo_frame:color_bar}
	http://example.org/some/image/path.jpg
{/exp:photo_frame:color_bar}

height=

This parameter will allow you to define the height of the colored boxes. You must define a unit of measure, either "px" or "%". The default height is 12px.


	{exp:photo_frame:color_bar file="/some/image/path.jpg" height="15px"}
	

total=

This parameter will change the number of colors used to generate the average color. By default, the 10 most used colors will be used to calculate the average.

width=

This parameter will allow you to define the width of the colored boxes. You must define a unit of measure, either "px" or "%". If no width is defined, the boxes will all be equal widths and cummulatively span 100% of the parent element.


	{exp:photo_frame:color_bar file="/some/image/path.jpg" width="15px"}