Color wheel: Difference between revisions

m
Line 330:
Image is same as Kotlin entry
</pre>
 
=={{header|J}}==
 
<lang J>rgbc=: {{1-x*0>.1<.(<.4&-)6|m+y%60}}
hsv=: 5 rgbc(,"0 1) 3 rgbc(,"0) 1 rgbc
degrees=: {{180p_1*{:"1+.^.y}}
wheel=: {{((1>:|)*|hsv degrees)j./~y%~i:y}}
require'viewmat'
'rgb' viewmat 256#.<.255*wheel 400</lang>
 
This color wheel has cyan at the top, red at the bottom, blue in the upper left part of the wheel and green in the upper right part of the wheel (yellow in the lower right, magenta in the lower left). The argument to wheel controls the radius of the circle (in pixels) -- in the above example, the circle is 801 pixels in diameter.
 
 
=={{header|Java}}==
6,962

edits