【问题标题】:jQuery color animations relative to the elements' current color (hue, saturation, brightness)相对于元素当前颜色(色调、饱和度、亮度)的 jQuery 颜色动画
【发布时间】:2012-01-31 18:33:46
【问题描述】:

我想在不明确指定绝对颜色的情况下制作彩色动画。举个例子:

我有一个divbackground: #2288ee。如果我想让它更亮,而不是写:

$('div').animate({'background-color': '#3399ff'});

我想写这样的东西:

$('div').brighten({'background-color': '10%'});

这个想法的核心是有相对值,以防设计发生变化,我不必调整每一个效果。

【问题讨论】:

    标签: javascript jquery animation colors


    【解决方案1】:

    您可以查看此存储库,它支持您的所有要求。(色调、饱和度、亮度等)

    https://github.com/jquery/jquery-color

    【讨论】:

      猜你喜欢
      • 2023-03-25
      • 2011-05-17
      • 2018-03-22
      • 1970-01-01
      • 2018-04-01
      • 2011-11-26
      • 2016-09-25
      • 1970-01-01
      • 2017-04-26
      相关资源
      最近更新 更多