Adding Color to the Price Ticker

Thu 6 August 2009

Another developer requested custom colors for the price changes in the Price Ticker instead of the current drab green and red. That seemed like a cool idea that would allow the ticker to fit into any web page, so I added it to the API.

The ticker now has the options up_color and down_color. Setting one or both of those will set the inline text color of the prices that have gone up and down. I also added styles to the color spans, which lets you set the colors in a stylesheet rather than through JavaScript. I will prefix all Black Lotus Project styles with "blproject_" to prevent any clashing. The classes are "blproject_price_up" and "blproject_price_down". If you want to set the colors with those styles, you also need to set either up_color or down_color to "none" to prevent the ticker from adding inline colors.

Crazy Examples

Loading...
Loading...
Loading...

New Ticker Options

up_color
Text color for prices that have stayed even or gone up since yesterday. A value of "none" will disable all inline color styles. Default: "green".
down_color
Text color for prices that have gone down since yesterday. A value of "none" will disable all inline color styles. Default: "#A03".

New Ticker Styles

.blproject_price_up
Text color for prices that have stayed even or gone up since yesterday. Either up_color or down_color must be set to the string "none" on the ticker for this style to have effect.
.blproject_price_down
Text color for prices that have gone down since yesterday. Either up_color or down_color must be set to the string "none" on the ticker for this style to have effect.

0 comments