Deviant Login Shop  Join deviantART for FREE Take the Tour
×

:iconjohnjensen: More from JohnJensen




Details

Submitted on
May 7
Image Size
20.5 KB
Resolution
550×400
Submitted with
Sta.sh
Link
Thumb
Embed

Stats

Views
688
Favourites
76 (who?)
Comments
11
Downloads
25
×
I used to have this code that let me get a color on the color wheel based on an angle, but I can't find it. So I decided to play a bit around with some RGB code and I made my own, then afterwards I started playing around with it and I made this little program.

Here's the function. Angles are in radians.

const PI2:Number = Math.PI * 2;

function color(angle:Number, mr:Number = 1.0, mg:Number = 0.667, mb:Number = 0.333):uint
{
   var r:uint = (uint(0xFF + 0xFF * Math.sin(angle + PI2 * mr)) * 0.5) & 0xFF;
   var g:uint = (uint(0xFF + 0xFF * Math.sin(angle + PI2 * mg)) * 0.5) & 0xFF;
   var b:uint = (uint(0xFF + 0xFF * Math.sin(angle + PI2 * mb)) * 0.5) & 0xFF;

   return r << 16 | g << 8 | b;
}
Add a Comment:
 
:iconprayoshiara:
PraYoshiAra Featured By Owner Jul 25, 2014  Hobbyist General Artist
I Love it! It's Awesome!
Reply
:iconnadiwa:
nadiwa Featured By Owner May 8, 2014  Hobbyist Traditional Artist
This will come in very handy, thank you for making it.
Reply
:iconjohnjensen:
JohnJensen Featured By Owner May 8, 2014
You're welcome. :D
Reply
:iconshiranoko:
Shiranoko Featured By Owner May 8, 2014  Hobbyist Traditional Artist
oh my gosh you are amazing o.o how did u come up with such an amazing idea? o.o
Reply
:iconjohnjensen:
JohnJensen Featured By Owner May 8, 2014
I was just playing around with color programming, and I thought making something like this could be useful. =P
Reply
:iconsketchedghost:
SketchedGhost Featured By Owner May 8, 2014  Student Digital Artist
This is insanely awesome! needs more attention.

:happybounce: 
Reply
:iconjohnjensen:
JohnJensen Featured By Owner May 8, 2014
Thank you :>
Reply
:iconspyro2bro:
Spyro2bro Featured By Owner May 7, 2014
Jaw drop madness
Reply
:iconjohnjensen:
JohnJensen Featured By Owner May 8, 2014
Thanks!
Reply
:iconequestriagurl77:
EquestriaGurl77 Featured By Owner May 7, 2014
I don't understand how this has no comments! It's literally one of the greatest things on DA, this truly deserves a Daily Deviation spot!
Reply
Add a Comment: