CadQuery / CadQuery/cadquery

Color Mismatch with Input in STEP File

Open
#1,411 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
Python
Stars
5.8k
Forks
541
Avg merge
3d 2h
Merged PRs (30d)
5

Description

```print(cq.Color('aliceblue').toTuple() == (.94,.97,1,1))```

I think the above statement should return True, unless I am doing something wrong.

X11 Color Spec:
https://en.wikipedia.org/wiki/X11_color_names

OpenCascade Uses X11 Color Spec: https://dev.opencascade.org/doc/refman/html/_quantity___name_of_color_8hxx.html#aadc2a1b709b06601041190b0a00c926aaf95b2f2152b5b664149575f43a349278

According to X11 spec which OCC uses for color AliceBlue should be 94, 97, 100 or normalized as (0.94, 0.97, 1.00, 1.00). When setting the color of an assembly using cq.Color('aliceblue') using the .toTuple() method of cq.Color gives (0.871366024017334, 0.9386860132217407, 1.0, 1.0). When writing this to a STEP file and exporting it causes the color to be off in the STEP file. Is there a way of getting these values correct?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.