SPQuad+ColorComponents

type:
extension
author:
Shilo White
description:
A category for Sparrow 2.X that allows a SPQuad (or subclass) to get/set red, green, and blue color components.
lastupdate:
2013-07-09
compatible:
v2.X
tag:
quad, image, color, red, green, blue
homepage:
https://gist.github.com/Shilo/5962180
download:
https://gist.github.com/Shilo/5962180/download

Usage

SPQuad *quad = [SPQuad quadWithWidth:100 height:100 red:255 green:255 blue:255];
[self addChild:quad];
 
quad.redValue = 0;
quad.greenValue = 0;
quad.blueValue = 0;
 
[quad setRedValue:255 ofVertex:0];
[quad setGreenValue:255 ofVertex:1];
[quad setBlueValue:255 ofVertex:2];
[quad setRed:255 green:255 blue:255 ofVertex:3];
 
NSLog(@"red:%i green:%i blue:%i", quad.redValue, quad.greenValue, quad.blueValue);
 
for (int i=0; i<4; i++)
    NSLog(@"vertex %i red:%i green:%i blue:%i", i, [quad redValueOfVertex:i], [quad greenValueOfVertex:i], [quad blueValueOfVertex:i]);

Changelog

  • 2013/07/10 01:20: First public version

Source Code

Discussion

No comments so far. Feel free to edit this part of the page.

  users/shilo/extensions/spquad_colorcomponents.txt · Last modified: 2013/07/10 01:23 by shilo
 
Powered by DokuWiki