Page 1 of 1

'dot' 2-D matrix needed

Posted: Sun Jun 19, 2016 11:37 am
by tester
I need something like a 'dot matrix', i.e. a graphical view that is splitted into a matrix of 'pixel' rectangles.

Inputs:

1) how many lines (x)
2) how many columns (y)

So this produces a 2-D matrix of x*y rectangles. Each rectangle should have it's own color or transparency or something like that.

3) Third input would contain an array of x*y values. Each value would represent a color. As for colors it does not matter, it can be a colorset or a manipulation of one color.

This is for static display.

Anyone played with such thing or has it and could share?

Re: 'dot' 2-D matrix needed

Posted: Sun Jun 19, 2016 12:06 pm
by KG_is_back
somethign like this?

Re: 'dot' 2-D matrix needed

Posted: Sun Jun 19, 2016 12:57 pm
by nix
ty KG-
that's neat

Re: 'dot' 2-D matrix needed

Posted: Sun Jun 19, 2016 6:01 pm
by tester
Thank you, this should do the job.

Re: 'dot' 2-D matrix needed

Posted: Thu Jun 23, 2016 9:53 pm
by tester
Hmm... I don't know to modify it, I'm getting errors.

I'd like to do 2 things here.

1) define main color (instead of shades of blackness) - I thought it would be simple

Color.new((@dat[x+y*@w]*255).to_i)
to something like:
Color.new((@dat[x+y*@w]*255,val1,val2,val3).to_i)
at least following the manual

2) actually, I'd like to have 2 distinct color gradings, one color for positive array values, and second color for negative array values, since some arrays have both.

Re: 'dot' 2-D matrix needed

Posted: Sun Jun 26, 2016 5:20 pm
by tester
I'm stuck with this one. I have no idea how to manipulate at least the main color a,r,g,b parameters. Help. :-)

(bi-color versus could be done simply with using 2 of such boxes, where transparencies on one box would be compensates by colors on the other)