File: colors.rst

package info (click to toggle)
ezdxf 1.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 104,528 kB
  • sloc: python: 182,341; makefile: 116; lisp: 20; ansic: 4
file content (126 lines) | stat: -rw-r--r-- 2,633 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
Colors Module
=============

.. module:: ezdxf.colors

This module provides functions and constants to manage all kinds of colors in
DXF documents.

Converter Functions
===================

.. autofunction:: rgb2int

.. autofunction:: int2rgb

.. autofunction:: aci2rgb

.. autofunction:: luminance

.. autofunction:: decode_raw_color

.. autofunction:: decode_raw_color_int

.. autofunction:: encode_raw_color

.. autofunction:: transparency2float

.. autofunction:: float2transparency

RGB Class
=========

.. autoclass:: RGB

    .. autoproperty:: luminance

    .. automethod:: to_hex

    .. automethod:: from_hex

    .. automethod:: to_floats

    .. automethod:: from_floats

RGBA Class
==========

.. autoclass:: RGBA

    .. autoproperty:: luminance

    .. automethod:: to_hex

    .. automethod:: from_hex

    .. automethod:: to_floats

    .. automethod:: from_floats

ACI Color Values
================

Common :ref:`ACI` values, also accessible as IntEnum :class:`ezdxf.enums.ACI`

=========================== ===
BYBLOCK                     0
BYLAYER                     256
BYOBJECT                    257
RED                         1
YELLOW                      2
GREEN                       3
CYAN                        4
BLUE                        5
MAGENTA                     6
BLACK (on light background) 7
WHITE (on dark background)  7
GRAY                        8
LIGHT_GRAY                  9
=========================== ===

Default Palettes
================

Default color mappings from :ref:`ACI` to :term:`true-color` values.

=========== =============================
model space DXF_DEFAULT_COLORS
paper space DXF_DEFAULT_PAPERSPACE_COLORS
=========== =============================

Raw Color Types
===============

======================= ====
COLOR_TYPE_BY_LAYER     0xC0
COLOR_TYPE_BY_BLOCK     0xC1
COLOR_TYPE_RGB          0xC2
COLOR_TYPE_ACI          0xC3
COLOR_TYPE_WINDOW_BG    0xC8
======================= ====

Raw Color Vales
===============

=================== ============
BY_LAYER_RAW_VALUE  -1073741824
BY_BLOCK_RAW_VALUE  -1056964608
WINDOW_BG_RAW_VALUE -939524096
=================== ============

Transparency Values
===================

======================= =========
OPAQUE                  0x20000FF
TRANSPARENCY_10         0x20000E5
TRANSPARENCY_20         0x20000CC
TRANSPARENCY_30         0x20000B2
TRANSPARENCY_40         0x2000099
TRANSPARENCY_50         0x200007F
TRANSPARENCY_60         0x2000066
TRANSPARENCY_70         0x200004C
TRANSPARENCY_80         0x2000032
TRANSPARENCY_90         0x2000019
TRANSPARENCY_BYBLOCK    0x1000000
======================= =========