Skip to content

Commit

Permalink
private
Browse files Browse the repository at this point in the history
  • Loading branch information
PankajBhojwani committed Sep 2, 2021
1 parent 12e8d6c commit 384bf49
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/cascadia/TerminalCore/ColorFix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,15 @@ ColorFix::ColorFix()
ColorFix::ColorFix(COLORREF color)
{
rgb = color;
ToLab();
_ToLab();
}

ColorFix::ColorFix(double l, double a, double b)
{
L = l;
A = a;
B = b;
ToRGB();
_ToRGB();
}

ColorFix::ColorFix(const ColorFix& color)
Expand All @@ -282,7 +282,7 @@ ColorFix::ColorFix(const ColorFix& color)
// - Populates our L, A, B values, based on our r, g, b values
// - Converts a color in rgb format to a color in lab format
// - Reference: http://www.easyrgb.com/index.php?X=MATH&H=01#text1
void ColorFix::ToLab()
void ColorFix::_ToLab()
{
//dE00::RGBToLAB(r, g, b, L, A, B);
double var_R = r / 255.0;
Expand Down Expand Up @@ -337,7 +337,7 @@ void ColorFix::ToLab()
// - Populates our r, g, b values, based on our L, A, B values
// - Converts a color in lab format to a color in rgb format
// - Reference: http://www.easyrgb.com/index.php?X=MATH&H=01#text1
void ColorFix::ToRGB()
void ColorFix::_ToRGB()
{
double var_Y = (L + 16.) / 116.;
double var_X = A / 500. + var_Y;
Expand Down Expand Up @@ -399,7 +399,7 @@ double ColorFix::DeltaE(ColorFix color)
}

// Method Description:
// - Given a background color, change our own color to make it more perceivable if necessary
// - Given a background color, change the foreground color to make it more perceivable if necessary
// - Arguments:
// - back: the color to compare against
// - pColor: where to store the resulting color
Expand Down Expand Up @@ -439,7 +439,7 @@ bool ColorFix::PerceivableColor(COLORREF back, ColorFix& pColor, double* oldDE,
}
wrap:
if (bChanged)
pColor.ToRGB();
pColor._ToRGB();
else
pColor = *this;
return bChanged;
Expand Down
5 changes: 2 additions & 3 deletions src/cascadia/TerminalCore/ColorFix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ struct ColorFix
ColorFix(double l, double a, double b);
ColorFix(const ColorFix& color);

void ToLab();
void ToRGB();

double DeltaE(ColorFix color);

bool PerceivableColor(COLORREF back, ColorFix& pColor, double* oldDE = NULL, double* newDE = NULL);
Expand All @@ -38,6 +35,8 @@ struct ColorFix
};

private:
void _ToLab();
void _ToRGB();
BYTE _Clamp(double v);
};

Expand Down

1 comment on commit 384bf49

@github-actions

This comment was marked as outdated.

Please sign in to comment.