Skip to content

Commit dfdf8e8

Browse files
committed
Add color types
1 parent 40a6901 commit dfdf8e8

2 files changed

Lines changed: 44 additions & 1 deletion

File tree

docs/python/pycc/others.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@ Others
22
======
33

44

5+
Rgb
6+
___
7+
.. seealso::
8+
9+
.. autoclass:: pycc.Rgb
10+
:members:
11+
:undoc-members:
12+
:show-inheritance:
13+
14+
15+
Rgba
16+
____
17+
.. seealso::
18+
19+
.. autoclass:: pycc.Rgba
20+
:members:
21+
:undoc-members:
22+
:show-inheritance:
23+
24+
525
ccScalarField
626
_____________
727
.. seealso::

wrapper/pycc/src/qcc_db/qcc_db.cpp

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,30 @@ void define_qcc_db(py::module &m)
7777
* qCC_db
7878
**********************************/
7979

80-
py::class_<ccColor::Rgba>(m, "Rgba");
80+
py::class_<ccColor::Rgba>(m, "Rgba", R"doc(
81+
RGBA color structure
82+
)doc")
83+
.def(py::init<>(), R"doc(Inits color to (0,0,0, 0))doc")
84+
.def(py::init<ColorCompType, ColorCompType, ColorCompType, ColorCompType>(),
85+
"r"_a,
86+
"g"_a,
87+
"b"_a,
88+
"a"_a)
89+
.def_readwrite("r", &ccColor::Rgba::r)
90+
.def_readwrite("g", &ccColor::Rgba::g)
91+
.def_readwrite("b", &ccColor::Rgba::b)
92+
.def_readwrite("a", &ccColor::Rgba::a)
93+
.def("__ne__", &ccColor::Rgba::operator!=);
94+
95+
py::class_<ccColor::Rgb>(m, "Rgb", R"doc(
96+
RGB color structure
97+
)doc")
98+
.def(py::init<>(), R"doc(Inits color to (0,0,0))doc")
99+
.def(py::init<ColorCompType, ColorCompType, ColorCompType>(), "r"_a, "g"_a, "b"_a)
100+
.def_readwrite("r", &ccColor::Rgb::r)
101+
.def_readwrite("g", &ccColor::Rgb::g)
102+
.def_readwrite("b", &ccColor::Rgb::b)
103+
.def("__ne__", &ccColor::Rgb::operator!=);
81104

82105
define_ccScalarField(m);
83106
define_ccGLMatrix(m);

0 commit comments

Comments
 (0)