问题标签 [nsgradient]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
ios - 在 iOS 上插入渐变颜色(与 NSGradient 一样)?
AppKit 在 iOS 中不可用,所以我一直在寻找替代品。
具体来说,我正在寻找一种替代方法:
我需要一种方法来定义渐变,并根据输入位置 ( float
) 查找颜色值。
macos - 如何将 NSGradient 绘制到 NSImage?
我正在尝试获取 NSGradient 并将其保存为 RubyMotion 中的图像,但我无法让它工作。这是我到目前为止的代码:
它运行没有错误,但保存的文件是空白的并且没有图像数据。谁能帮我指出正确的方向?
objective-c - Change NSGradient colors in OSX 10.7 and 10.8
I have a NSView
subclass named OneView
with the following code:
In my AppDelegate
(or could be any other class), I am trying to change the colors of the gradient by calling the changeGradient
method of the OneView
class:
When the view is first loaded the gradient is initialized as expected but I am unable to change the gradient from the IBAction
method. I have achieved this using layer backed views but I am trying to find a way that doesn't rely on layers for backwards compatibility.
Any thoughts on why the IBAction
is not changing the gradient?
objective-c - 将 NSGradient 转换为 NSColor
好的,长话短说:
- 我正在使用(嵌入到包中)FontAwesome
- 我将它用作某些自定义
NSButton
s中的字体 - 在
NSButton
我想为它们着色的子类中,与 Xcode 选项卡项的着色方式完全相同
这就是我设置颜色的方式(作为简单的 NSColor):
如何将其设置为NSGradient
?
swift - 纹理 NSWindow 背景渐变
我正在尝试生成我自己的纹理 NSWindow,以便它以与默认金属外观不同的渐变出现。
到目前为止,我已经将 NSWindow 子类化,但没有成功,如下所示。
我什至会以正确的方式解决这个问题吗?
objective-c - CGContextSetFill 渐变
我目前有一个绘制二维码的功能
目前,我可以使用以下方法设置颜色,包括颜色空间:
我正在尝试实现创建渐变的能力,我已经将两个转换NSColors
为一个NSGradient
- 似乎没有任何方法可以获得渐变,NSColor
所以我想知道设置填充的最佳方法是什么渐变的上下文?
在此先感谢您的任何建议!