I can set the color of layer by Ruby API ,but I can not by C API.
Is this a question or you just saying… ?
Yup as that Tracker issue mentions, you access via the Layer’s material in the C API.
But ! do not assign any layer material to anything else especially geometry or image objects. A layer’s material is owned by that layer and is unique and must not be shared.
I can do it by RubyAPI, but I can not do it by CAPI.
Sketchup.active_model.layers.first.color = 'red'
When I copy the layer from a.skp to b.skp, I find can not copy the color of layer.
Causes the layer color to be black.
You mean that’s all right?
// get material SULayerGetMaterial() ; // then change color ? SUMaterialSetColor();
This looks strange，but I will try it.