Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
32c562bd
Commit
32c562bd
authored
Apr 19, 1999
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
colorsys docs from David Ascher.
parent
9d158817
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
+54
-0
Doc/lib/libcolorsys.tex
Doc/lib/libcolorsys.tex
+54
-0
No files found.
Doc/lib/libcolorsys.tex
0 → 100644
View file @
32c562bd
\section
{
\module
{
colorsys
}
---
Conversions between color systems
}
\declaremodule
{
standard
}{
colorsys
}
\modulesynopsis
{
Conversion functions between RGB and other color systems.
}
\sectionauthor
{
David Ascher
}{
da@python.net
}
The
\module
{
colorsys
}
module defines bidirectional conversions of
color values between colors expressed in the RGB (Red Green Blue)
color space used in computer monitors and three other coordinate
systems: YIQ, HLS (Hue Lightness Saturation) and HSV (Hue Saturation
Value). Coordinates in all of these color spaces are floating point
values. In the YIQ space, the Y coordinate is between 0 and 1, but
the I and Q coordinates can be positive or negative. In all other
spaces, the coordinates are all between 0 and 1.
More information about color spaces can be found at
\url
{
http://www.inforamp.net/
\%
7epoynton/ColorFAQ.html
}
.
The
\module
{
colorsys
}
module defines the following functions:
\begin{funcdesc}
{
rgb
_
to
_
yiq
}{
r, g, b
}
Convert the color from RGB coordinates to YIQ coordinates.
\end{funcdesc}
\begin{funcdesc}
{
yiq
_
to
_
rgb
}{
y, i, q
}
Convert the color from YIQ coordinates to RGB coordinates.
\end{funcdesc}
\begin{funcdesc}
{
rgb
_
to
_
hls
}{
r, g, b
}
Convert the color from RGB coordinates to HLS coordinates.
\end{funcdesc}
\begin{funcdesc}
{
hls
_
to
_
rgb
}{
h, l, s
}
Convert the color from HLS coordinates to RGB coordinates.
\end{funcdesc}
\begin{funcdesc}
{
rgb
_
to
_
hsv
}{
r, g, b
}
Convert the color from RGB coordinates to HSV coordinates.
\end{funcdesc}
\begin{funcdesc}
{
hsv
_
to
_
rgb
}{
h, s, v
}
Convert the color from HSV coordinates to RGB coordinates.
\end{funcdesc}
Example:
\begin{verbatim}
>>> import colorsys
>>> colorsys.rgb
_
to
_
hsv(.3, .4, .2)
(0.25, 0.5, 0.4)
>>> colorsys.hsv
_
to
_
rgb(0.25, 0.5, 0.4)
(0.3, 0.4, 0.2)
\end{verbatim}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment