V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
XDDD
V2EX  ›  iDev

基于 Swift 的主题色提取库: ColorArtwork

  •  
  •   XDDD · 2017-03-04 14:17:50 +08:00 · 3393 次点击
    这是一个创建于 2602 天前的主题,其中的信息可能已经有所发展或是发生改变。

    从一张图片中提取出 1 个背景色和 3 个主题色。

    基于这个博客的算法,只用了 CoreGraphics 所以兼容果家的全平台。

    https://github.com/XQS6LB3A/ColorArtwork

    大概效果:

    2 条回复    2017-03-05 18:03:48 +08:00
    yepinf
        1
    yepinf  
       2017-03-04 18:09:12 +08:00
    挺好玩的样子,用于图文混编很合适

    支持一下
    XDDD
        2
    XDDD  
    OP
       2017-03-05 18:03:48 +08:00
    @yepinf 目前只考虑到用于专辑插图,其他用途请注意:
    - 处理时直接丢弃了 alpha 通道,透明图片的结果可能和预期不一致
    - 由于要对图片中所有像素计数,速度可能稍慢。一张 600*600 的图片要花费 0.1 秒
    - 为了提高效率,过大的图片将自动缩放至 300*300 ,处理时间降至 0.03 秒
    - 如果图片比较复杂,缩放后颜色的准确度会降低。若有此要求,请手动指定图片尺寸
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5348 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 08:58 · PVG 16:58 · LAX 01:58 · JFK 04:58
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.