神刀安全网

Maniac Dev : BCColor – Swift Based Color Helper Library For Gradients, Getting Image Colors And Image And More

BCColor is an open source Swift based helper library from Boyce Chang providing an assortment of color helpers with a clean syntax.

BCColor includes helpers for:

  • Getting colors from an image
  • Setting colors to monchrome
  • Getting lighter/darker colors
  • Creating gradients
  • Colors from hex values

This snippet from the readme shows the basic usage of BCColor:

// Pick Colors From Image  let colors = image?.bc_getColors()    // Generate Momochrome Image  let monochromeImage = image?.bc_monochrome()    // Hex Color  UIColor.bc_colorWithHex("#5d13e2", alpha: 1)    // Gradient Color  UIColor.bc_gradientColor(CGPointMake(0.0, 0.0), endPoint: CGPointMake(1.0, 1.0), frame:frame, colors: [UIColor.redColor(), UIColor.blueColor()])    UIColor.bc_radialGradientColor(frame, colors: [UIColor.blueColor(), UIColor.greenColor()])

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » Maniac Dev : BCColor – Swift Based Color Helper Library For Gradients, Getting Image Colors And Image And More

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
分享按钮