Skip to content
Forum Archive

There's no purple in the rainbow?

66 posts

^..^#

There's no purple in the rainbow?

I tried to make a color-spectrum, but somehow i always get this disturbing gap between blue and red instead of violet and purple. Can anyone please help?
MaTTFURY#
^..^#
thanks. but that was not quite my question. I've got more a "thechnical" avs problem here, I was wondering, why the colors merge correctly into each other, except from blue to red. Got any idea?
Nolita#edited
I saw violet in a preset(don't remember which), I don't know if it's a legitimate AVS color, but you could try it.

I'm going to fiddle around with this some, and see what I cand do(if anything).

*************************************
Minor Fiddling around, nothing fancy.
*************************************

Grr, one step forward and two steps back. It's not really what you want, but channel shift placed beneath the ssc will give you violet🙂🙁 Unfortunately, it only shifts the problem. Yellow and orange are now absent🙁

*************************************
I'm off to tinker some more🙂
*************************************
Nolita#
I think I found some possible help. In Pak-9's AVS 4 SE pack, there's a preset called "Collaborations - Montana vs Pack-9 - Winterkitten." It contains a rainbow with sort of a purple mist swirling around it. There isn't a single color map in the whole darned thing, no invert either. There are however,
7 superscopes, + several other elements/apes at work.

Unless somebody more experienced has your answer, and can give it to you off the top of their head, I'm going to try and isolate, what makes the purple. I'm almost positive your scope needs more code. What I'm not sure of is whether or not you will need at least one more ssc to make the effect you want.
Nolita#
Quick disclaimer, since I'm still very new, I don't know how much this will help, but it's from the preset I was telling you about.
____________________________________
  • init
    p=acos(-1); n=128;
  • frame
    af=min(h,w)/max(h,w);
  • beat
    vv=getosc(0.45,0,0);
  • point
    r=i*p-p*0.5; d=0.2;
    x=af*sin(r)*d; y=-cos(r)*d+0.25;
    red=c*0.75; green=0; blue=c*0.9;
    c=if(above(abs(vv),0.5),0.5,1);

____________________________________
That makes a purple arc.
Tuggummi#
- Don't use linesize=h for a fullscreen gradient since linesize is capped at 256, there for your gradient will "break" after that and most of the people do use taller window size than 256. Instead center the line at the y-axis and then just use a movement with y=0.

- If you use a numpoint value that depends on the screen size it is best to define it per frame, that way it will have enough points even if the user changes the resolution without reloading the preset (entering fullscreen for example).

- The AVS window goes from -1 to 1 on both x & y axis, so when you define x=(i-0.5)*3 it ranges from -1.5 to 1.5 and there for you're drawing stuff that's outside the screen.



Oh and here's a simple method for doing a rainbow gradient, but im too lazy to explain it.
(gah, fine, so i can't explain it 🧟 satisfied? 🙁)
^..^#
thank you all for your efforts! I've got a free minute right now, so i can work through your tips! Hopefully i'll get it to work...
@ nolita: i remember this preset but infortunately the rainbow is rendered by a few sperated lines, so i cannot (or am to stupid to) use it. 😉

Sorry, tug, for those "noobish mistakes".
Normally i do use just a single-line scope + y=0 movement and i keep (i-0.5)*2..., but since i was concentrated on the color code on this one i didn't pay attention to formality. 😛

However, it's just what i was looking for. But you have to explain one thing: why do you add 2.07 / 4.14?? I changed the values in my code from $pi/2 and $pi to yours and voilá: it works!! Any idea??

-----------EDIT----------

I got it!!!
2.07 is roughly 2/3 * $pi (so 4.14 is 4/3 * $pi). So i just shifted the color phases by the wrong values. Damn! How stuuupid!!!
Warrior of the Light#
Guess I'm too late, but here it is anyway
^..^#
Thanks for this one too!
It also illustrates the "technical background of the color spectrum. (The three sinus-waves: red green and blue, and the amount their phases are shifted against each other).
Nice work!
Nolita#
Yay!

I'm happy the violet question has been answerred.😁 Only now I'm lost again.🙁 In Tuggummi's spectrum the following code is used for the color:

red=sin(ipi+2.07+t)*intes+bright ;
green=sin(ipi+4.18+t)*intes+bright ;
blue=sin(ipi+t)*intes+bright

It introduces terms/variables to code that I hadn't seen before. intes+bright ; I have to ask, are there other terms that I would never think to include in code? Is there a place where I can find a list of these "unconventional" terms/variables? Mind you I'm not entirely sure variable is the right word. I searched and searched, even using words like tutorial, list, and variables.

BTW, just from a single color perspective, I'm trying a theory of any color being possible by converting hex to rbg. I have no idea if it will work though🙂
S-uper_T-oast#
Correct me if I'm wrong, don't you just have to use the hue saturation and lumenise(sp) color values then convert them into red green and blue?
Tuggummi#
Nolita, those aren't any "real" terms/variables, i just named them that way 🙂 There are only a very few variables that are taken, those include x,y,w,h,i,red,green,blue,b and linesize for superscope and x,y,w,h,b and alpha for dynamic movement.

The rest is custom, so when i named a variable 'intes' it should be pretty obvious when you change it, it changes the intesity of the colors 🙂 and i think you know what 'bright' means 😉
Warrior of the Light#edited
[sp fix] intensitiy, not intesity

Other fixed variables are for:
effect lists, alphain, alphaout and enabled (and beat instead of b)
bump b gives -1/1 instead of 0/1.
//edit - thanks tuggummi: and bi for bump intensity
Movement uses sw and sh instead of w and h.
Texer2 uses sizex and sizey for image resolutions (1=100%)

That's about it, I think
PAK-9#
read the expression help, justin took 5 minutes of his lunch break to write it, you could at least look at it once.
Tuggummi#
Why on earth paks? When it's obviously so much more fun to post about it so that we regulars can post pump without it looking like post pumping.
Warrior of the Light#
Sorry, I was working with a pc without WA when I wrote it.
(a crappy Pentium1 75MHz with 32Mb RAM, yes those still exist 🧟)
PAK-9#
You should install wa on it... get some really technical AVS's running, mmm... frameratelicious
Warrior of the Light#
Too bad the HDD is only 0.99Gb. Together with all programs I need to work with, depending on the size of the temporary internet files (which I have to delete from time to time because the drive's full (not that I am not asked to clean up my hdd with every reboot as it is (which happens ~3x per day due to BSOD's))) leaves me 20Mb max.
//takes a deep breath
Okay, 20MB is more than enough, and since WA crashes not more often than my PC, that doesn't matter too. (That's my PC being bad, not AVS so good)



...


..




...







now if only I a soundcard. 😛




(hopefully I will get a P3-500 next week or even in the end of this week, if it isn't ordered by another collegue[sp] yet - Yes I know my status around there... 😢 )
^..^#
Originally posted by WarriorO/TLight
Sorry, I was working with a pc without WA when I wrote it.
(a crappy Pentium1 75MHz with 32Mb RAM, yes those still exist 🧟)
How on earth can you call this "working"? And where did you get this relic of an ancient civilisation?
MaTTFURY#
i got a bunch of old 386 servers in the shed out the back ill give them away for Free... lol
Nolita#
Speaking of taking all of 5 minutes to do something: Pak-9, would you mind terribly if I took your tutorial and convert it to html? I wouldn't change it beyond linking each section from the table of contents to it's corresponding page. I only want to do that so it's easier to use. I'm just asking because I know some people hate when you just up and convert one of their documents to html. Right now I'm using find, but being able to click a link to the specific page(s) I'm looking for would be easier.