Cadence Skill 论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 6568|回复: 2

[AXL函数] axlColorLoad

[复制链接]
发表于 2015-2-11 17:24:46 | 显示全部楼层 |阅读模式
axlColorLoad(
t_file/nil
) -> t/nil   

描述

用于加载Allegro PCB Editor 颜色文件 (后缀为.col ). 颜色文件保存在路径: <cdsroot>/share/pcb/text/lallegro.col.注cdsroot为安装路径。

颜色文件格式 :

#     Comment if in first column.

#N     Next line with a number is number of colors (currently only 24 is supported). This should appear first in the file.

Number format

#Number

24

#B - next line with a number is background color. This should appear after color number. Format of color line must be:

(name is currently ignored):

0 <red> <green> <blue> [<name>]

EXAMPLE of background format setting it to black

#Background Color

0 0 0 0

#I - next set of lines sets the colors. These should always appear last in the file. We will read until the first color number that exceeds the color number (currently hardcoded as 24) or the end of file is

reached. The order the colors appear in the file determines the initial color [priority (highest (first) to lowest (last)].

Format is:

<color number> <pen number> <red> <green> <blue> [<name>]

EXAMPLE:

1 1 255 255 255 White

2 2 14 210 255 LtBlue

<color number>: entry in color table. This is the color number referenced by the allegro subclass (axlLayerGet)

<pen number>: Used by Allegro plot (UNIX) to control what pen to use during plotting. Not applicable on Windows.

<red> intensity of red to blend into color 0 to 255

<green> intensity of green to blend into color 0 to 255

<blue> intensity of blue to blend into color 0 to 255

<name> (optional) name of color, currently not used by Allegro but sigxp takes advantage of the name to auto-assign colors.

当更新颜色文件并加载后,需要调用 axlVisibleUpdate 函数更新显示,否则可能会导致颜色还保留在之前的设置。

当新建一个allegro brd文件时,allegro会自动加载颜色文件(16X默认加载allegro_192.col),当新建brd成功并保存后,就不再使用该col文件了,所有的颜色数据保存在brd文件数据库中,所以后续更新颜色就需要在allegro brd文件

中更新。修改allegro_192.col可修改新建brd默认的颜色。一般不建议这样操作。


参数

s_file 需要加载的颜色文件路径

nil 使用默认的 lallegro.col. 文件。如果未指定路径,则allegro默认查找环境变量LOCALPATH所指定路径下的颜色文件


返回值

t 颜色文件加载成功

nil 颜色文件未找到或者颜色文件格式错误。


参考函数

axlColorSave,axlColorSet


例子

加载allegro默认颜色文件,并更新allegro显示:
axlColorLoad(nil)
axlVisibleUpdate(t)

相关帖子

发表于 2021-10-26 23:06:08 | 显示全部楼层
版主能发个例子讲解一下加载设定路径下的col文件吗?还是没看懂怎么操作
发表于 2021-11-22 17:24:54 | 显示全部楼层
版主能发个例子讲解一下加载设定路径下的col文件吗?还是没看懂怎么操作
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|网站地图|Cadence Skill 论坛 ( 蜀ICP备13024417号 )

GMT+8, 2024-4-19 22:37 , Processed in 0.153058 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表