如何在iPhone中绘制色轮?

时间:2012-03-24 12:12:16

标签: iphone ios

我想像Adobe一样在kuler中绘制自定义色轮(用于iphone)。这里的任何人都可以告诉我如何继续吗?

我已经做了足够多的谷歌,但结果都没有给我我想要的东西?

提前致谢

4 个答案:

答案 0 :(得分:1)

(根据要求发布答案)

我认为这就是你要找的东西:

How to draw a color wheel in objective-c

答案 1 :(得分:1)

2019年的更新:自iOS 10起,现在可以使用内置的CoreImage滤镜CIHueSaturationValueGradient绘制色轮。更多信息in this blog post。色轮可以像这样{Swift}生成为UIImage

let filter = CIFilter(name: "CIHueSaturationValueGradient", parameters: [
    "inputColorSpace": CGColorSpaceCreateDeviceRGB(),
    "inputDither": 0,
    "inputRadius": 160,
    "inputSoftness": 0,
    "inputValue": 1
])!
let image = UIImage(ciImage: filter.outputImage!)

答案 2 :(得分:0)

你说你做了很多谷歌搜索,但你没有提到你去过的链接。

这两个问题(都在SO上)几乎与你的相同,他们都接受了答案:

Color wheel or color picker in iOS

How to draw a color wheel in objective-c

这是一个很好的色轮,例如: http://www.markj.net/iphone-uiimage-pixel-color/

一个有用的颜色选择源: https://github.com/unixpickle/ANColorPicker

答案 3 :(得分:0)

此项目适用于iPhone。 它是100%HTML5 / Canvas,现在可以在iPhone上运行。

虽然它不是为它设计的,而是为iPad使用,所以尺寸略大。但它可以轻松修改为iPhone宽度。

https://github.com/JSdc/adobe-kuler-clone