Hi,
I am wondering how to compare RColor. https://www.qcad.org/doc/qcad/latest/de ... color.html
Like I want to check if the color of an object is the same as a specific color.
I tried different things but none of them seem to work
Comparing RColor
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Re: Comparing RColor
Operators cannot be overwritten in JavaScript, so they are exposed to scripts as functions. The comparison operator (==) is available as equals:
Code: Select all
if (col1.equals(col2)) {
...
}
-
- Active Member
- Posts: 29
- Joined: Wed Jun 14, 2023 4:02 pm
Re: Comparing RColor
Cool, thanks, will try it (not an expert in JS lol)andrew wrote: ↑Mon Jun 26, 2023 6:51 pmOperators cannot be overwritten in JavaScript, so they are exposed to scripts as functions. The comparison operator (==) is available as equals:
Code: Select all
if (col1.equals(col2)) { ... }