<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph with edges [(0, 1), (1, 2)], how can you use a custom attribute collector defined with `AttributeCollectorMeta` to convert default vertex hex color codes to RGB tuples and apply a default size to vertices?
### Response:
import igraph as ig

# Define a custom attribute collector with default values
# and a prefix for keyword arguments

# A helper function to convert colors
def hex_to_rgb(hex_color):
    hex_color = hex_color.lstrip('#')
    lv = len(hex_color)
    return tuple(int(hex_color[i:i + lv // 3], 16) for i in range(0, lv, lv // 3))

# Defining the attribute collector class
class MyAttributeCollector(metaclass=ig.AttributeCollectorMeta):
    _kwds_prefix = 'vertex_'
    color = ('#ff0000', hex_to_rgb)  # Default color: red
    size = (20, None)             # Default size: 20

# Create a graph with custom attributes
g = ig.Graph(edges=[(0, 1), (1, 2)], directed=True)
# Collect attributes using our custom collector
collector = MyAttributeCollector(g.vs)

# Now collector['color'] will return RGB tuples instead of hex values
for v in g.vs:
    print('Vertex', v.index, 'color:', collector['color'])
<|EOT|>
