Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ColorManagement: renamed .legacyMode to .enabled #24700

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/manual/en/introduction/Color-management.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,11 @@ <h3>Input color space</h3>
each have an associated color space. Those not already in the Linear-sRGB working color
space must be converted, and textures be given the correct <i>texture.encoding</i> assignment.
Certain conversions (for hexadecimal and CSS colors in sRGB) can be made automatically if
the legacy color management mode is disabled before initializing colors:
color management is enabled before initializing colors:
</p>

<code>
THREE.ColorManagement.legacyMode = false;
THREE.ColorManagement.enabled = true;
</code>

<ul>
Expand Down Expand Up @@ -272,7 +272,7 @@ <h2>Working with THREE.Color instances</h2>
</code>

<p>
With <i>ColorManagement.legacyMode = false</i> set (recommended), certain conversions
With <i>ColorManagement.enabled = true</i> set (recommended), certain conversions
are made automatically. Because hexadecimal and CSS colors are generally sRGB, [page:Color]
methods will automatically convert these inputs from sRGB to Linear-sRGB in setters, or
convert from Linear-sRGB to sRGB when returning hexadecimal or CSS output from getters.
Expand Down
4 changes: 2 additions & 2 deletions src/math/ColorManagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const FN = {

export const ColorManagement = {

legacyMode: true,
enabled: false,

get workingColorSpace() {

Expand All @@ -37,7 +37,7 @@ export const ColorManagement = {

convert: function ( color, sourceColorSpace, targetColorSpace ) {

if ( this.legacyMode || sourceColorSpace === targetColorSpace || ! sourceColorSpace || ! targetColorSpace ) {
if ( ! this.enabled || sourceColorSpace === targetColorSpace || ! sourceColorSpace || ! targetColorSpace ) {

return color;

Expand Down