Skip to content

Commit cdfd121

Browse files
update docs
1 parent 6c49fd2 commit cdfd121

File tree

6 files changed

+0
-20
lines changed

6 files changed

+0
-20
lines changed

cedargrove_rgb_spectrumtools/grayscale.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2022 JG for Cedar Grove Maker Studios
2-
#
32
# SPDX-License-Identifier: MIT
43
"""
54
`cedargrove_rgb_spectrumtools.grayscale`

cedargrove_rgb_spectrumtools/iron.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2022 JG for Cedar Grove Maker Studios
2-
#
32
# SPDX-License-Identifier: MIT
43
"""
54
`cedargrove_rgb_spectrumtools.iron`
@@ -72,22 +71,18 @@ def index_to_rgb(index=0, gamma=0.5):
7271
red = 0.1
7372
grn = 0.1
7473
blu = (0.2 + (0.8 * map_range(band, 0, 70, 0.0, 1.0))) ** gamma
75-
# if band >= 70 and band < 200: # blue to violet
7674
if 70 <= band < 200: # blue to violet
7775
red = map_range(band, 70, 200, 0.0, 0.6) ** gamma
7876
grn = 0.0
7977
blu = 1.0**gamma
80-
# if band >= 200 and band < 300: # violet to red
8178
if 200 <= band < 300: # violet to red
8279
red = map_range(band, 200, 300, 0.6, 1.0) ** gamma
8380
grn = 0.0
8481
blu = map_range(band, 200, 300, 1.0, 0.0) ** gamma
85-
# if band >= 300 and band < 400: # red to orange
8682
if 300 <= band < 400: # red to orange
8783
red = 1.0**gamma
8884
grn = map_range(band, 300, 400, 0.0, 0.5) ** gamma
8985
blu = 0.0
90-
# if band >= 400 and band < 500: # orange to yellow
9186
if 400 <= band < 500: # orange to yellow
9287
red = 1.0**gamma
9388
grn = map_range(band, 400, 500, 0.5, 1.0) ** gamma

cedargrove_rgb_spectrumtools/n_color.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2022 JG for Cedar Grove Maker Studios
2-
#
32
# SPDX-License-Identifier: MIT
43
"""
54
`cedargrove_rgb_spectrumtools.n_color_spectrum`
@@ -161,9 +160,4 @@ def color(self, index=0):
161160
grn = int(round((grn**self._gamma) * 0xFF, 0))
162161
blu = int(round((blu**self._gamma) * 0xFF, 0))
163162

164-
"""# need to test this improvement over ^
165-
red = min(int(round((red**self._gamma), 0)), 0xFF)
166-
grn = min(int(round((grn**self._gamma), 0)), 0xFF)
167-
blu = min(int(round((blu**self._gamma), 0)), 0xFF)"""
168-
169163
return (int(red) << 16) + (int(grn) << 8) + int(blu)

cedargrove_rgb_spectrumtools/n_color_table.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2022 JG for Cedar Grove Maker Studios
2-
#
32
# SPDX-License-Identifier: MIT
43
"""
54
`cedargrove_rgb_spectrumtools.n-color_table`

cedargrove_rgb_spectrumtools/stoplight.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2022 JG for Cedar Grove Maker Studios
2-
#
32
# SPDX-License-Identifier: MIT
43
"""
54
`cedargrove_rgb_spectrumtools.stoplight`
@@ -69,7 +68,6 @@ def index_to_rgb(index=0, gamma=0.5):
6968

7069
band = index * 600 # an arbitrary spectrum band index; 0 to 600
7170

72-
# if band >= 0 and band < 300: # green to yellow
7371
if 0 <= band < 300: # green to yellow
7472
red = map_range(band, 0, 300, 0.0, 1) ** gamma
7573
grn = map_range(band, 0, 300, 0.25, 1) ** gamma

cedargrove_rgb_spectrumtools/visible.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2022 JG for Cedar Grove Maker Studios
2-
#
32
# SPDX-License-Identifier: MIT
43
"""
54
`cedargrove_rgb_spectrumtools.visible`
@@ -48,22 +47,18 @@ def index_to_rgb(index=0, gamma=0.5):
4847
red = ((-1.0 * (wavelength - 440) / (440 - 380)) * intensity) ** gamma
4948
grn = 0.0
5049
blu = (1.0 * intensity) ** gamma
51-
# if wavelength >= 440 and wavelength < 490:
5250
if 440 <= wavelength < 490:
5351
red = 0.0
5452
grn = (1.0 * (wavelength - 440) / (490 - 440)) ** gamma
5553
blu = 1.0**gamma
56-
# if wavelength >= 490 and wavelength < 510:
5754
if 490 <= wavelength < 510:
5855
red = 0.0
5956
grn = 1.0**gamma
6057
blu = (-1.0 * (wavelength - 510) / (510 - 490)) ** gamma
61-
# if wavelength >= 510 and wavelength < 580:
6258
if 510 <= wavelength < 580:
6359
red = (1.0 * (wavelength - 510) / (580 - 510)) ** gamma
6460
grn = 1.0**gamma
6561
blu = 0.0
66-
# if wavelength >= 580 and wavelength < 645:
6762
if 580 <= wavelength < 645:
6863
red = 1.0**gamma
6964
grn = (-1.0 * (wavelength - 645) / (645 - 580)) ** gamma

0 commit comments

Comments
 (0)