Home > PCB_Layer > setInactiveLayerTransparency
PCB_Layer.setInactiveLayerTransparency() method
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Set the inactive layer transparency
Signature
typescript
function setInactiveLayerTransparency(transparency: number): Promise<boolean>;1
Parameters
Parameter | Type | Description |
|---|---|---|
transparency | number | Transparency, range |
Returns
Promise<boolean>
Whether the operation is successful
Example
javascript
// 1. 将非激活层透明度设为 60,让当前编辑层更突出
const setResult = await eda.pcb_Layer.setInactiveLayerTransparency(60);
// 2. 恢复为 0(不透明),避免影响日常查看
const restoreResult = await eda.pcb_Layer.setInactiveLayerTransparency(0);
console.log('setResult:', setResult);
console.log('restoreResult:', restoreResult);1
2
3
4
5
6
7
8
2
3
4
5
6
7
8