| |
|
|
KHR | Hello together,
I Search a routine, with the itself to charge can, whether two colours for our eye enough of each other deviation, say we enough Farbkontrast having circa deutliche Abgrenzug To make possible.
as example have I here a Democode, the Rechtecke with Zufallsfarben darstellt.
mostly weichen these colours vigorously of each other ex. sometimes are you but unfortunately very akin.
How can I the in the program-term discern, circa z.B. The Zufallsfarbe new to charge To let?? CompileMarkSeparation |
|
|
|
|
| Something like?
Ähnlichkeit To Black: CompileMarkSeparation or. CompileMarkSeparation How our eye becomes here however unregarded there our eyes RGB not linear erfassen separate durchschnittlich sooner to ruddy+green and yellow(=Rot+green)+blue and brightness. (hierbei but faith I do not vordergründig)
anyway but gives these function not from, that ruddy and green or blue and ruddy same are.
The Ähnlichkeit To knows would given, if the Return Value 1-x taken would. |
|
|
| |
|
|
|
KHR | Hello David
thanks for your Solution. I habs time into bicycles reingebastelt. CompileMarkSeparationFahrräder
by Karl-Heinz Rattay / 2009
einfach ausprobieren
Wems gefällt der kann ja einen screensaver draus machen!
Dieses Modul ist einfach so wie es ist. Wems nicht gefällt, der kann umstricken!!
declare r&, g&, b&, diff&, mix&, lastmix&
declare Zaehler&
proc zeichne
parameters c&,hpos%,vpos%, size%
usepen 0,(size%/5),c&
useBrush 0,c&
ellipse (hpos%-(Size%/1.5)),(vpos%-(Size%/1.5)) - (hpos%+(Size%/1.5)),(vpos%+(Size%/1.5))
ellipse ((hpos%+size%*2.0)-(Size%/1.5)),(vpos%-(Size%/1.5)) - ((hpos%+size%*2.0)+(Size%/1.5)),(vpos%+(Size%/1.5))
usepen 0,(size%/8),c&
moveto hpos%,vpos%
lineto (hpos%+(size%/6)),(vpos% - (Size%*1.05))
lineto (hpos%+(size%*1.7)) , (vpos% - (Size%*0.95) + (size%/6))
lineto (hpos%+(size%*1.1)) , vpos%
moveto (hpos%+(size%/4)),(vpos% - (Size%*1.3))
lineto (hpos%+(size%/6)),(vpos% - (Size%*1.3))
lineto (hpos%+(size%/6)),(vpos% - (Size%*1))
lineto (hpos%+(size%*1.1)) , vpos%
lineto (hpos%+(size%*2)) , vpos%
lineto (hpos%+(size%*1.7)) , (vpos% - (Size%*1) + (size%/6))
lineto (hpos%+(size%*1.7)) , (vpos% - (Size%*1) -(size%/7))
moveto (hpos%+(size%*1.7)-(size%/5)) , (vpos% - (Size%*1.1) -(size%/8))
lineto (hpos%+(size%*1.7)+(size%/5)) , (vpos% - (Size%*1.1) -(size%/8))
moveto (hpos%+(size%*1.1)) , (vpos%-(size%*0.3))
lineto (hpos%+(size%*1.1)) , (vpos%+(size%*0.3))
Endproc
proc FARBAEHNLICHKEIT
PARAMETERS FARBE1&,FARBE2&
RETURN (ABS(GETRVALUE(FARBE1&)-GETRVALUE(FARBE2&))+ABS(GETGVALUE(FARBE1&)-GETGVALUE(FARBE2&))+ABS(GETBVALUE(FARBE1&)-GETBVALUE(FARBE2&))) * 0.001307189542483660130718954248
endproc
cls
showmax
randomize
while 1
inc zaehler&
if zaehler& > 80
while 1
r&=Rnd(256)
g&=Rnd(256)
b&=Rnd(256)
mix&=@rgb(r&,g&,b&)
Case FARBAEHNLICHKEIT (lastmix&,mix&) :CONTINUE
lastmix&=mix&
BREAK
endwhile
zeichne @rgb(r&,g&,b&) ,
((%maxx*0.6) + @rnd(%maxx/4)) ,
(100+@rnd(@rnd(%maxy*0.85))) ,
(15+@rnd(40))
zaehler& = 1
endif
copyBmp 1,0 - %maxx,%maxy > 0,0;0
case @IsKey(27) : end ESC gedrückt
s4 href='./../../Function-References/XProfan/endwhile/'>endwhile
I bid moreover as comparison The Solution from the Nachbarforum on. CompileMarkSeparationbicycles
by Karl-Heinz Rattay / 2009
simply try
Wems gefällt the can Yes a screensaver draus make!
this Module is simply so How it is. Wems not gefällt, the can umstricken!!
declare r&, g&, b&, diff&, mix&, lastmix&
declare Zaehler&
proc draw
parameters c&,hpos%,vpos%, size%
usepen 0,(size%/5),c&
useBrush 0,c&
ellipsis (hpos%-(Size%/1.5)),(vpos%-(Size%/1.5)) - (hpos%+(Size%/1.5)),(vpos%+(Size%/1.5))
ellipsis ((hpos%+size%*2.0)-(Size%/1.5)),(vpos%-(Size%/1.5)) - ((hpos%+size%*2.0)+(Size%/1.5)),(vpos%+(Size%/1.5))
usepen 0,(size%/8),c&
moveto hpos%,vpos%
lineto (hpos%+(size%/6)),(vpos% - (Size%*1.05))
lineto (hpos%+(size%*1.7)) , (vpos% - (Size%*0.95) + (size%/6))
lineto (hpos%+(size%*1.1)) , vpos%
moveto (hpos%+(size%/4)),(vpos% - (Size%*1.3))
lineto (hpos%+(size%/6)),(vpos% - (Size%*1.3))
lineto (hpos%+(size%/6)),(vpos% - (Size%*1))
lineto (hpos%+(size%*1.1)) , vpos%
lineto (hpos%+(size%*2)) , vpos%
lineto (hpos%+(size%*1.7)) , (vpos% - (Size%*1) + (size%/6))
lineto (hpos%+(size%*1.7)) , (vpos% - (Size%*1) -(size%/7))
moveto (hpos%+(size%*1.7)-(size%/5)) , (vpos% - (Size%*1.1) -(size%/8))
lineto (hpos%+(size%*1.7)+(size%/5)) , (vpos% - (Size%*1.1) -(size%/8))
moveto (hpos%+(size%*1.1)) , (vpos%-(size%*0.3))
lineto (hpos%+(size%*1.1)) , (vpos%+(size%*0.3))
Endproc
cls
showmax
randomize
while 1
inc zaehler&
if zaehler& > 80
while 1
r& = Rnd(256)
g& = Rnd(256)
b& = Rnd(256)
mix& =(r&+g&+b&)/3
diff& = Abs(lastmix&-mix&)
Case diff&<40 : CONTINUE
lastmix& = mix&
BREAK
endwhile
draw @rgb(r&,g&,b&) ,
((%maxx*0.6) + @rnd(%maxx/4)) ,
(100+@rnd(@rnd(%maxy*0.85))) ,
(15+@rnd(40))
zaehler& = 1
endif
copyBmp 1,0 - %maxx,%maxy > 0,0;0
case @IsKey(27) : end ESC pressed
endwhile
can someone Differences in the Farbverteilung discern?
I faith already something recognized to have, with the Result were I but - Perhaps reports itself indeed someone of you |
|
|
| Gruß Karl-Heinz WIN XP home/Pro / XPROFAN 11 / P2CPP ATMEL + BASCOM Fan | 03/14/09 ▲ |
|
|
|
|
| The Difference is, that the Algo r+g+b colourblind is. One rotes Pixel is thereafter just as wertig like a Grünes, what then but nothing more To do has with whether two colours for our eye enough of each other deviation. |
|
|
| |
|
|