Skip to content

ColorManagement: Improve Nomenclature. #31152

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

Merged
merged 3 commits into from
May 24, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions src/math/ColorManagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ function createColorManagement() {

},

fromWorkingColorSpace: function ( color, targetColorSpace ) {
workingToColorSpace: function ( color, targetColorSpace ) {

return this.convert( color, this.workingColorSpace, targetColorSpace );

},

toWorkingColorSpace: function ( color, sourceColorSpace ) {
colorSpaceToWorking: function ( color, sourceColorSpace ) {

return this.convert( color, sourceColorSpace, this.workingColorSpace );

Expand Down
27 changes: 2 additions & 25 deletions src/nodes/display/ColorSpaceNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,36 +126,16 @@

export default ColorSpaceNode;

/**
* TSL function for converting a given color node to the current output color space.
*
* @tsl
* @function
* @param {Node} node - Represents the node to convert.
* @returns {ColorSpaceNode}
*/
export const toOutputColorSpace = ( node ) => nodeObject( new ColorSpaceNode( nodeObject( node ), WORKING_COLOR_SPACE, OUTPUT_COLOR_SPACE ) );

/**
* TSL function for converting a given color node to the current working color space.
*
* @tsl
* @function
* @param {Node} node - Represents the node to convert.
* @returns {ColorSpaceNode}
*/
export const toWorkingColorSpace = ( node ) => nodeObject( new ColorSpaceNode( nodeObject( node ), OUTPUT_COLOR_SPACE, WORKING_COLOR_SPACE ) );

/**
* TSL function for converting a given color node from the current working color space to the given color space.
*
* @tsl
* @function
* @param {Node} node - Represents the node to convert.
* @param {string} colorSpace - The target color space.

Check failure on line 135 in src/nodes/display/ColorSpaceNode.js

View workflow job for this annotation

GitHub Actions / Lint testing

Expected JSDoc for 'targetColorSpace' but found 'colorSpace'
* @returns {ColorSpaceNode}
*/
export const workingToColorSpace = ( node, colorSpace ) => nodeObject( new ColorSpaceNode( nodeObject( node ), WORKING_COLOR_SPACE, colorSpace ) );
export const workingToColorSpace = ( node, targetColorSpace ) => nodeObject( new ColorSpaceNode( nodeObject( node ), WORKING_COLOR_SPACE, targetColorSpace ) );

/**
* TSL function for converting a given color node from the given color space to the current working color space.
Expand All @@ -163,10 +143,10 @@
* @tsl
* @function
* @param {Node} node - Represents the node to convert.
* @param {string} colorSpace - The source color space.

Check failure on line 146 in src/nodes/display/ColorSpaceNode.js

View workflow job for this annotation

GitHub Actions / Lint testing

Expected JSDoc for 'sourceColorSpace' but found 'colorSpace'
* @returns {ColorSpaceNode}
*/
export const colorSpaceToWorking = ( node, colorSpace ) => nodeObject( new ColorSpaceNode( nodeObject( node ), colorSpace, WORKING_COLOR_SPACE ) );
export const colorSpaceToWorking = ( node, sourceColorSpace ) => nodeObject( new ColorSpaceNode( nodeObject( node ), sourceColorSpace, WORKING_COLOR_SPACE ) );

/**
* TSL function for converting a given color node from one color space to another one.
Expand All @@ -180,8 +160,5 @@
*/
export const convertColorSpace = ( node, sourceColorSpace, targetColorSpace ) => nodeObject( new ColorSpaceNode( nodeObject( node ), sourceColorSpace, targetColorSpace ) );

addMethodChaining( 'toOutputColorSpace', toOutputColorSpace );
addMethodChaining( 'toWorkingColorSpace', toWorkingColorSpace );

addMethodChaining( 'workingToColorSpace', workingToColorSpace );
addMethodChaining( 'colorSpaceToWorking', colorSpaceToWorking );
Loading