根据图像最小主色改变图像标题的颜色

时间:2014-09-29 12:13:35

标签: javascript jquery html

我试图找出一种方法,如果显示图像标题的图像颜色相同,我可以将图像标题颜色更改为其他颜色。

我在图像的左下方显示图像标题&图像颜色和图像可能是有可能的。标题颜色不一样,使标题阅读困难。

我发现以下链接可根据图像的更多颜色更改背景颜色。

https://github.com/briangonzalez/jquery.adaptive-backgrounds.js

我试图实现相同的文字,但它不起作用...我在这里设置了一个小提琴示例http://jsfiddle.net/4do2n5qt/1/

CODE:

<div class="wrapper">
    <div class="box">
        <img src="http://farm9.staticflickr.com/8378/8559402848_9fcd90d20b_b.jpg" data-adaptive-background='1'/>
        <div class="caption">Caption here</div>
    </div>
    <div class="box">
        <img src="http://www.arup.com/~/media/Images/Projects/O/Oresund_Link/Gallery/Images/Oresund2_900x600.ashx?mh=800&mw=1000" data-adaptive-background='1'/>
        <div class="caption">Caption here</div>
    </div>
        <div class="box">
        <img src="http://www.argesit.net/plantillas/fx-template/images/Galeria/1small9-900x600.jpg" />
        <div class="caption">Caption here</div>
    </div>
        <div class="box">
        <img src="http://www.colouration.co.uk/wp-content/uploads/2012/08/Gap-03-900-X-600-pixels.jpg" />
        <div class="caption">Caption here</div>
    </div>
</div>

在此示例中,标题是可读的,但在实际情况下,某些图像具有白色背景,使图像标题几乎不可见。

0 个答案:

没有答案
相关问题