Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- draw_color_square(hue){
- var gradB = this.ctx.createLinearGradient(0, 0, 0, 255);
- gradB.addColorStop(0, "white");
- gradB.addColorStop(1, "black");
- var gradC = this.ctx.createLinearGradient(0,0,255,0);
- gradC.addColorStop(0, "hsla(" + hue + ",100%,50%,0)");
- gradC.addColorStop(1, "hsla(" + hue + ",100%,50%,1)");
- this.ctx.fillStyle = gradB;
- this.ctx.fillRect(0, 0, 255, 255);
- this.ctx.fillStyle = gradC;
- this.ctx.globalCompositeOperation = "multiply";
- this.ctx.fillRect(0, 0, 255, 255);
- this.ctx.globalCompositeOperation = "source-over";
- }
Add Comment
Please, Sign In to add comment