Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-06-2006, 10:12 AM   #1
Registered User
Join Date: Aug 2005
Location: Chelmsford, Essex, UK
Posts: 72
Default advanced color manipulation

Hello to you all.

I know how to manipulate hex colours by splitting the num bers up and perfoming calcutaions on them using bit-operators. Thats fine...

but i now need to manipulate colour not using the normal RGB. I need to be able to add two colours together like paint. E.g. red and blue equals purple, yellow and blue equals green.

Has anyon e had any experience with this and even more importantly can it be done? (i assume it can... nothings impossible)


JimmyH is offline   Reply With Quote
Old 06-06-2006, 10:52 AM   #2
FormerSwinger's Avatar
Join Date: May 2005
Location: Finland
Posts: 382

that's a bit tricky. Yes, I believe it's possible but I have no clue about the maths involved.

The problem is that if you add all color components together in rgb you get white where in real life you would end up with black (in a perfect world) or dark brown.

Also in real life the main colors are red yellow and blue instead of red green and blue. so in rgb yellow is red and green, in the real world this would give you something brownish I think?

If I were you I'd try to search the math someplace else e.g math forums, image manipulation forums etc.
Just that it hasn't been done before doesn't mean it's impossible.
FormerSwinger is offline   Reply With Quote
Old 06-06-2006, 01:46 PM   #3
Registered User
Join Date: Aug 2005
Location: Chelmsford, Essex, UK
Posts: 72

thanks mate...

Thats exactly what i've been doing and i have the maths now. I have some functions that work now and i will be putting a class togather at some point over the next few days.

But i have a nother problem... adding two CMYK colours together... take this problem for example. We know that if we add red paint and blue paint we get purple paint. Simple... most people learnt that in junior school. The mathematical values of the paints are


c = 0
m = 100
y = 100


c = 100
m = 100
y = 0

now the cmy value for purple is:

c = 50
m = 100
y = 0

so whats the formular for merging the red and the blue to get the purple figures. it's baffling me quite a bit (reccon it's pretty simple but it's escaping me!)

edit... and i'll be off to some maths forums as well i'd expect
JimmyH is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Best Advanced Actionscript 2 Book blueboxgamer ActionScript 2.0 4 08-18-2005 04:07 AM
FOED Advanced PHP for Flash book - i wouldn't feed it to my dog snapple General Chat 10 11-21-2003 12:11 PM
Highscore Simple & Advanced Madokan Server-Side Scripting 0 05-27-2003 09:23 AM
Advanced AS book? Forcer ActionScript 1.0 (and below) 17 08-18-2001 03:12 AM

All times are GMT. The time now is 11:16 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.