How to pass color value from input to output in custom python node I want to make custom node that can be used in compositing nodes. I stuck in part when I need to pass color value (and do some operation on that) from input to output socket.

def init(self, context):
    inp = self.inputs.new('NodeSocketColor', "Input 1")
    inp2 = self.inputs.new('NodeSocketColor', "Input 2")

    out = self.outputs.new('NodeSocketColor', "Out")
    out2 = self.outputs.new('NodeSocketColor', "Out 2")



I don't know how to set up links (inp -> out, inp2 -> out2). Outputs are always connected to the first input socket.
How to change value before outputting.
From the code above I'm not exactly sure how to give a contextually direct solution, but in an attempt to help move along the issue...


Set up a node tree reference: 

tree = bpy.context.scene.node_tree
Set up a link reference:

your_links = tree.links
Make your links:

your_link = your_links.new(your_node.outputs[0],another_node.inputs[0])


To change the values you could do something like:

your_node.inputs[0].default_value = 0.3