ID:2732034
 
Code:
obj/color_plane
screen_loc = "1,1"
plane = COLOR_PLANE
appearance_flags = PLANE_MASTER
color=list(-1.090, 1.290, 0.226, 0.000,
0.578, 0.278, 0.004, 0.000,
0.068, 2.070, -0.422, 0.000,
0.000, 0.000, 0.000, 1.000)

//When i don't remove last column it dont work to.

/*
From generator:

<svg xmlns="http://www.w3.org/2000/svg">
<filter id="filter">
<feColorMatrix
type="matrix"
values="-1.090 1.290 0.226 0.000 0.010
0.578 0.278 0.004 0.000 0.010
0.068 2.070 -0.422 0.000 0.010
0.000 0.000 0.000 1.000 0.000">
</feColorMatrix>
</filter>
</svg>

*/


Problem description:

Im trying to figure how matrix color works. I like effect like this one (dark): color = list(null,null,null,null,"#333f")
I'm not sure what mean list(null,null,null,null,"#333f"). (reference said - list(red_row, green_row, blue_row, alpha_row, constant_row))
I tried some online generator (like https://fecolormatrix.com/) to get effect i want. But after all it seems doesn't work. I see differences..
My expected:

My result:
The main problem you're having with your plane master is that it needs a backdrop object.

Change the plane's screen_loc to "CENTER" since that will make a lot of this easier. Add an overlay with a layer like BACKGROUND_LAYER+1 and a plane of FLOAT_PLANE, and give it a black icon. Scale that up with a transform to be big enough to cover the entire viewport.
Maybe I'm to stupid, but I don't know what i do wrong. :(( I want effect from 2 gif, just want a different screen color.
1st attempt:

2nd attempt:


world
fps = 25
icon_size = 16
turf = /turf
mob = /mob

turf
icon = 'Icons.dmi'
icon_state="grass"

client
fps=40
var/obj/screenColor/screenColor

New()
// screen += screenColor = new(src)
. = ..()

mob
icon = 'Icons.dmi'
icon_state = "mob"
step_size = 2

Login()
..()
/*
verb/Sepia()
set category = "Test"
animate(client.screenColor,
color=list(0.393, 0.768, 0.188, 0.000,
0.349, 0.685, 0.167, 0.000,
0.272, 0.533, 0.130, 0.000,
0.000, 0.000, 0.000, 1.000), time = 20)


Sepia from Generator:

<svg xmlns="http://www.w3.org/2000/svg">
<filter id="filter">
<feColorMatrix
type="matrix"
values=" 0.393 0.768 0.188 0.000 0.000
0.349 0.685 0.167 0.000 0.000
0.272 0.533 0.130 0.000 0.000
0.000 0.000 0.000 1.000 0.000">
</feColorMatrix>
</filter>
</svg>
*/


/*
obj
screenColor

icon = 'Icons.dmi'
plane = 2
layer = OBJ_LAYER+1
screen_loc = "CENTER"
color=list(-1.090, 1.290, 0.226, 0.000,
0.578, 0.278, 0.004, 0.000,
0.068, 2.070, -0.422, 0.000,
0.000, 0.000, 0.000, 1.000)

appearance_flags = PLANE_MASTER
New()
..()
overlays += new/obj/spotlight


spotlight
icon = 'Icons.dmi'
//icon_state = "black"
plane = FLOAT_PLANE
layer = BACKGROUND_LAYER+1
New()
..()
transform = matrix(11 , 0, 0, 0, 11, 0)
*/



obj/lighting_plane
screen_loc = "1,1"
plane = 2
blend_mode = BLEND_MULTIPLY
appearance_flags = PLANE_MASTER | NO_CLIENT_COLOR
// use 20% ambient lighting; be sure to add full alpha
//color = list(null,null,null,null,"#333f")

color=list(0.393, 0.768, 0.188, 0.000,
0.349, 0.685, 0.167, 0.000,
0.272, 0.533, 0.130, 0.000,
0.000, 0.000, 0.000, 1.000)

mouse_opacity = 0 // nothing on this plane is mouse-visible

image/spotlight
plane = 2
blend_mode = BLEND_ADD
icon = 'Icons.dmi' // a 96x96 white circle
pixel_x = -32
pixel_y = -32

mob/Login()
..()
client.screen += new/obj/lighting_plane
overlays += /image/spotlight


Bump?
In response to Barto444
Not necessary to bump. This was one of two top topics in this category.

Lummox suggested before your last post to add an overlay to that plane so that the overlay is expanded across the entire screen as well.(with the transform applied)

He's also THE MAN so you may want to take his suggestion on the screen_loc setting to CENTER.

In response to Shadowkaroth
I know who is THE MAN. :) If you read my last post probably you saw commented code. This is "attempt 2" and as we can see on 1st gif, it doesn't work.
    verb/Sepia()
set category = "Test"
animate(client.screenColor,
color=list(0.393, 0.768, 0.188, 0.000,
0.349, 0.685, 0.167, 0.000,
0.272, 0.533, 0.130, 0.000,
0.000, 0.000, 0.000, 1.000), time = 20)


Sepia from Generator:

<svg xmlns="http://www.w3.org/2000/svg">
<filter id="filter">
<feColorMatrix
type="matrix"
values=" 0.393 0.768 0.188 0.000 0.000
0.349 0.685 0.167 0.000 0.000
0.272 0.533 0.130 0.000 0.000
0.000 0.000 0.000 1.000 0.000">
</feColorMatrix>
</filter>
</svg>

obj
screenColor

icon = 'Icons.dmi'
plane = 2
layer = OBJ_LAYER+1
screen_loc = "CENTER"
color=list(-1.090, 1.290, 0.226, 0.000,
0.578, 0.278, 0.004, 0.000,
0.068, 2.070, -0.422, 0.000,
0.000, 0.000, 0.000, 1.000)

appearance_flags = PLANE_MASTER
New()
..()
overlays += new/obj/spotlight


spotlight
icon = 'Icons.dmi'
//icon_state = "black"
plane = FLOAT_PLANE
layer = BACKGROUND_LAYER+1
New()
..()
transform = matrix(11 , 0, 0, 0, 11, 0)
In response to Barto444
Ahh I see, well in that example. Example 2 it seems you do not have the blend_modes set, try that as well on that version of the attempt.

I know in your screenie you are editing the plane masters blend but it seems you edited it to 1 or 2 but in your code it seems you need MULTIPLE which is 4. Just a thought.

Also not sure if the backdrop needs BLEND_ADD but your second example doesn't have it.
Backdrops should have BLEND_OVERLAY.
Could someone refactore my code? I'm dont know what i do wrong.. :( I tried all combination with blend_mode. :/

#define SEPIA list(0.39, 0.769, 0.189, 0,  0, 0.349, 0.686, 0.168, 0,  0,  0.272, 0.534, 0.131, 0,  0, 0,  0, 0, 1,  0)
#define CUSTOM list(-1.090, 1.290, 0.226, 0.000, 0.578, 0.278, 0.004, 0.000, 0.068, 2.070, -0.422, 0.000, 0.000, 0.000, 0.000, 1.000)
#define INVERT list(-1, 0, 0, 0, 0,0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1)
#define BLACK20 list(null,null,null,null,"#333f") //from references
#define INVERT2 list(-1,0,0, 0,-1,0, 0,0,-1, 1,1,1)

var/list/colorList = list(
"SEPIA" = SEPIA,
"BLACK20%" = BLACK20,
"CUSTOM" = CUSTOM,
"INVERT" = INVERT,
"INVERT_12" = INVERT2,
)


world
fps = 25
icon_size = 16
turf = /turf
mob = /mob

turf
icon = 'Icons.dmi'
icon_state="grass"

client
fps=40
var/obj/screenColorPlane/screenColor

New()
screen += screenColor = new(src)
. = ..()

mob
icon = 'Icons.dmi'
icon_state = "mob"
step_size = 2

verb/setColorScreen()
set category = "Test"
var/nColor = input("Set Color") in colorList
animate(client.screenColor,
color=colorList[nColor], time = 20)

obj

screenColorPlane
plane = 2
layer = OBJ_LAYER+1
screen_loc = "CENTER"
blend_mode = BLEND_MULTIPLY
appearance_flags = PLANE_MASTER
color=BLACK20 // 20% ambient lighting
New()
..()
overlays += new/image/spotlight

image
spotlight
icon = 'Icons.dmi'
icon_state = "black"
plane = FLOAT_PLANE
layer = BACKGROUND_LAYER+1
blend_mode = BLEND_OVERLAY
New()
..()
transform = matrix(6 , 0, 0, 0, 6, 0)


Demo:
https://drive.google.com/file/d/ 1sWF-C_0QMmx6ZY-C04POl8vu43TCw0a9/view?usp=sharing



Okay it's me, i made it, but i have one more question..

look at gif 1, there is what lum explain for me earlier, and it work fine. But i want effect like "sepia"(when i can use full potential of matrix toys) on my light_plane. Not just add solid color.(gif2) Right now this night effect looks soo flat.I'm pretty sure understand why its doesn't work like i want - (because plane, it is on plane 2 like only spotlight), but can i somehow walk around?

gif1:



gif2:
Your sepia matrix is wrong. It looks like you might have it transposed.

There should be five rows in the matrix, with four columns each. The list is in row-major order, so the 1st row items come first, then the 2nd row, and so on.

Your sepia matrix looks like this:

0.39  0.769 0.189 0
0 0.349 0.686 0.168
0 0 0.272 0.534
0.131 0 0 0
0 0 1 0

Clearly that is not right.

Think of each row in the matrix as a different input component: red, green, blue, alpha, and constant. Each column is the output.

If you look at your sepia matrix again, you're turning alpha into 13.1% red; you're adding a constant 100% blue to all pixels.
This is outdated:
0.39  0.769 0.189 0
0 0.349 0.686 0.168
0 0 0.272 0.534
0.131 0 0 0
0 0 1 0

here is correct sepia
list(0.25,0.25,0.25,0,0.5,0.5,0.5,0,0.125,0.125,0.125,0,0.2,0.2,0.2,0,0,0,0,1)

But my main problem is my lighting_plane. It's blend_mode = BLEND_MULTIPLY, and all i can change, is last row (constant_row) its don't see any changes in red, green, blue, alpha input components.
I want to change red, green, blue, alpha and constants, because my night effect look not good enough.

sepia effect on plane master:
obj/screenColorPlane
screen_loc = "1,1"
plane = 2
blend_mode = BLEND_MULTIPLY
appearance_flags = PLANE_MASTER | NO_CLIENT_COLOR



sepia on FLOAT_PLANE
obj
lighting_plane2
screen_loc = "1,1"
plane = FLOAT_PLANE
blend_mode = BLEND_OVERLAY
appearance_flags = PLANE_MASTER


You really shouldn't be screwing with alpha in a lighting plane. The matrix you're using isn't even an actual sepia tone, and it messes with alpha. In my experience no good can come of that when applied to a lighting plane.

What I still don't see is any evidence that you're using an actual backdrop anywhere on your lighting planes. Without a backdrop, it will usually look wrong.