Skip to content

Commit a02c17d

Browse files
docs/functions.rst: document new colors_*() functions.
1 parent 4e6cadd commit a02c17d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/functions.rst

+15
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ Yet others are handy, general-purpose utilities.
6666
:meth:`sRGB_to_rgb` return (R, G, B) color tuple from an sRGB integer
6767
:meth:`unicode_to_glyph_name` return glyph name from a unicode
6868
:meth:`get_tessdata` locates the language support of the Tesseract-OCR installation
69+
:meth:`colors_pdf_dict` return dict of color names.
70+
:meth:`colors_wx_list` return list of color names.
6971
:attr:`fitz_fontdescriptors` dictionary of available supplement fonts
7072
:attr:`PYMUPDF_MESSAGE` destination of |PyMuPDF| messages.
7173
:attr:`pdfcolor` dictionary of almost 500 RGB colors in PDF format.
@@ -874,4 +876,17 @@ Yet others are handy, general-purpose utilities.
874876

875877
Return the "standard" empty and invalid rectangle `Rect(2147483520.0, 2147483520.0, -2147483648.0, -2147483648.0)` resp. quad. Its top-left and bottom-right point values are reversed compared to the infinite rectangle. It will e.g. be used to indicate empty bboxes in `page.get_text("dict")` dictionaries. There are however infinitely many empty or invalid rectangles.
876878

879+
-----
880+
881+
.. method:: colors_pdf_dict()
882+
883+
Returns a dict mapping lower-case color name to `(red, green, blue)`
884+
tuple, and `red`, `green`, `blue` are floats in range 0..1.
885+
886+
.. method:: colors_wx_list()
887+
888+
Returns a list of `(colorname, red, green, blue)` tuples, where
889+
`colorname` is upper case and `red`, `green`, `blue` are integers in
890+
range 0..255.
891+
877892
.. include:: footer.rst

0 commit comments

Comments
 (0)