EA中获取元素背景颜色

Get element background color in EA

如何使用官方API获取元素(例如边界)的颜色?

我假设它保存在 t_objects -> backcolor 的数据库中,但我无法在 Element 中找到 property/method 来获取它。

有none。您需要使用

repository.SQLQuery("SELECT Backcolor, Bordercolor, BoderWidth, Fontcolor FROM t_object WHERE ...")

Coloring values in EA have simple RGB values without transparency. Each red, blue and green value can take an intensity from 0 to 255. The RGB itself is calculated by

 RGB = (blue * 256 + green) * 256 + red 

The default coloring is equal to -1.

来自我的 Scripting EA 书。