ActionScript 渐变带问题
我在渐变的某些颜色之间出现条带时遇到一个奇怪的问题。
为了创建渐变,我从中心到边界绘制均匀间隔的圆楔形,并从循环中的位图线渐变像素填充每个圆楔形。
我正在创建一个包含 3600 个楔子的圆,尽管根据从红色到黄色数字渐变生成的橙色屏幕截图来看,它看起来并不像它。在红色和黄色之间添加橙色数字没有帮助。但如果我只用 360 个楔子创建圆,则渐变带会更加明显。 3600 可能有点矫枉过正,并且并没有真正添加更多细节,例如,制作 1440 楔形的圆圈,但我不知道有任何其他方法可以稍微提升此条带问题。
我有什么想法可以解决这个问题,或者我做错了什么?难道是circleMatrix旋转造成的?
i'm having a strange issue with banding between certain colors of a gradient.
to create the gradient, i'm drawing evenly spaced circle wedges from the center to the border, and filling each circle wedge from a bitmap line gradient pixel in a loop.
i'm creating a circle with 3600 wedges, although it doesn't look like it based on the screen shot within the orange color that is produced from gradating from red to yellow numbers. adding a orange number between red and yellow doesn't help. but if i create the circle with only 360 wedges, the gradient banding is much more obvious. 3600 is probably overkill, and doesn't really add more detail over, say, making the circle of 1440 wedges, but i don't know any other way to slightly elevate this banding issue.
any ideas how i can fix this, or what i'm doing wrong? could it be caused by the circleMatrix rotation?
alt text http://www.freeimagehosting.net/uploads/7e3382befe.jpg
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
编辑:
由于精度误差,可能会出现一些伪影,因为您只有 255 个值的范围可供分配。
为了最小化这种视觉效果,您可以尝试在色带中添加一些模糊,但要注意左侧和右侧之间的连接:
没有完整的代码来测试,很难知道我的目标是否正确;)
i*Math.pi/180
而不是 /1800,因此现在您可以转到360
而不是 < code>3600为什么从1开始而不是从0开始?
尝试调整线条粗细并使用 lineGradientStyle
您引用了
objMatrix
但创建了CircleMatrix
Edit:
Due to precision error some artifact can appear since you have only a range of 255 values to distribute.
To minimize this visual effect you can try to add some blur to your color band, but beware of the join between the left and the right side :
Without full code to test, hard to know if i aim in the right direction ;)
i*Math.pi/180
and not /1800, so now you can go to360
and not3600
why start from 1 and not from 0 ?
try to play with the line thickness and use the lineGradientStyle
You referer to an
objMatrix
but create acircleMatrix
我认为条带是由你的比率引起的。
试试这个:
另外,objMatrix实际上应该是circleMatrix吗?
您可以在 LiveDoc 的
I think the banding is being caused by your ratios.
Try this:
Also, should objMatrix actually be circleMatrix?
You can see the difference between [127, 255] and [0, 255] in the LiveDoc's