简体   繁体   English

画布渐变

[英]Canvas Gradient

I'm trying to create a color selector shaped like a triangle. 我正在尝试创建形状像三角形的颜色选择器。 I'm looking at things like color wheel( http://jweir.github.com/colorwheel/ ) but I don't know how to modify it so that I can change the shape of the square to a triangle 我正在查看色轮( http://jweir.github.com/colorwheel/ )之类的东西,但我不知道如何对其进行修改,以便可以将正方形的形状更改为三角形

the simplest method would be to have an image with all your colors pre-drawn. 最简单的方法是预先绘制所有颜色的图像。 cope the image to a canvas and use canvasPixelArray to get the color and alpha if desired. 将图像处理到画布上,并根据需要使用canvasPixelArray获取颜色和Alpha。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM