@@ -533,6 +533,19 @@ template<class T> void color3(py::class_<Math::Color3<T>, Math::Vector3<T>>& c)
533533 return Math::Color3<T>::fromSrgb (srgb);
534534 }, " Create linear RGB color from 24-bit sRGB representation" , py::arg (" srgb" ))
535535
536+ .def_static (" red" , &Math::Color3<T>::red,
537+ " Red color" , py::arg (" red" ) = Math::Implementation::fullChannel<T>())
538+ .def_static (" green" , &Math::Color3<T>::green,
539+ " Green color" , py::arg (" green" ) = Math::Implementation::fullChannel<T>())
540+ .def_static (" blue" , &Math::Color3<T>::blue,
541+ " Blue color" , py::arg (" blue" ) = Math::Implementation::fullChannel<T>())
542+ .def_static (" cyan" , &Math::Color3<T>::cyan,
543+ " Cyan color" , py::arg (" red" ) = T (0 ))
544+ .def_static (" magenta" , &Math::Color3<T>::magenta,
545+ " Magenta color" , py::arg (" green" ) = T (0 ))
546+ .def_static (" yellow" , &Math::Color3<T>::yellow,
547+ " Yellow color" , py::arg (" blue" ) = T (0 ))
548+
536549 /* Accessors */
537550 .def (" to_srgb_int" , &Math::Color3<T>::toSrgbInt,
538551 " Convert to 32-bit integral sRGB representation" )
@@ -583,6 +596,31 @@ template<class T> void color4(py::class_<Math::Color4<T>, Math::Vector4<T>>& c)
583596 return Math::Color4<T>::fromSrgb (srgb, a);
584597 }, " Create linear RGBA color from 32-bit sRGB a alpha representation" , py::arg (" srgb" ), py::arg (" a" ) = Math::Implementation::fullChannel<T>())
585598
599+ .def_static (" red" , &Math::Color4<T>::red,
600+ " Red color" ,
601+ py::arg (" red" ) = Math::Implementation::fullChannel<T>(),
602+ py::arg (" alpha" ) = Math::Implementation::fullChannel<T>())
603+ .def_static (" green" , &Math::Color4<T>::green,
604+ " Green color" ,
605+ py::arg (" green" ) = Math::Implementation::fullChannel<T>(),
606+ py::arg (" alpha" ) = Math::Implementation::fullChannel<T>())
607+ .def_static (" blue" , &Math::Color4<T>::blue,
608+ " Blue color" ,
609+ py::arg (" blue" ) = Math::Implementation::fullChannel<T>(),
610+ py::arg (" alpha" ) = Math::Implementation::fullChannel<T>())
611+ .def_static (" cyan" , &Math::Color4<T>::cyan,
612+ " Cyan color" ,
613+ py::arg (" red" ) = T (0 ),
614+ py::arg (" alpha" ) = Math::Implementation::fullChannel<T>())
615+ .def_static (" magenta" , &Math::Color4<T>::magenta,
616+ " Magenta color" ,
617+ py::arg (" green" ) = T (0 ),
618+ py::arg (" alpha" ) = Math::Implementation::fullChannel<T>())
619+ .def_static (" yellow" , &Math::Color4<T>::yellow,
620+ " Yellow color" ,
621+ py::arg (" blue" ) = T (0 ),
622+ py::arg (" alpha" ) = Math::Implementation::fullChannel<T>())
623+
586624 /* Accessors */
587625 .def (" to_srgb_alpha_int" , &Math::Color4<T>::toSrgbAlphaInt,
588626 " Convert to 32-bit integral sRGB + linear alpha representation" )
0 commit comments