Skip to content

Commit 9d6e0c4

Browse files
committed
Palette::getColor made const
1 parent d12e552 commit 9d6e0c4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

source/MRViewer/MRPalette.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,12 +478,12 @@ void Palette::draw( const std::string& windowName, const ImVec2& pose, const ImV
478478
ImGui::End();
479479
}
480480

481-
Color Palette::getColor( float val )
481+
Color Palette::getColor( float val ) const
482482
{
483483
assert( val >= 0.f && val <= 1.f );
484484

485485
// only the first row represents the actual palette colours; see `Palette::updateDiscretizatedColors_' for more info
486-
const std::span<Color> colors( texture_.pixels.data(), texture_.resolution.x );
486+
const std::span<const Color> colors( texture_.pixels.data(), texture_.resolution.x );
487487
if ( val == 1.f )
488488
return colors.back();
489489

source/MRViewer/MRPalette.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class Palette
8989
// return color according val and setting filter type
9090
// Discrete: returns color for given value
9191
// Linear: get interpolated color from the init vector
92-
MRVIEWER_API Color getColor( float val );
92+
MRVIEWER_API Color getColor( float val ) const;
9393

9494
const MeshTexture& getTexture() const
9595
{

0 commit comments

Comments
 (0)