Skip to content

Commit

Permalink
[de] Refactor previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillovIlya committed Dec 10, 2024
1 parent ba6d81e commit 4bc5c90
Showing 1 changed file with 21 additions and 32 deletions.
53 changes: 21 additions & 32 deletions word/Editor/Styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -9483,38 +9483,27 @@ CDocumentColor.prototype.ToHexColor = function() {
CDocumentColor.prototype.ToHighlightColor = function()
{
// 17.18.40 ST_HighlightColor
if (0x00 === this.r && 0x00 === this.g && 0x00 === this.b)
return "black";
else if (0x00 === this.r && 0x00 === this.g && 0xFF === this.b)
return "blue";
else if (0x00 === this.r && 0xFF === this.g && 0xFF === this.b)
return "cyan";
else if (0x00 === this.r && 0x00 === this.g && 0x8B === this.b)
return "darkBlue";
else if (0x00 === this.r && 0x8B === this.g && 0x8B === this.b)
return "darkCyan";
else if (0xA9 === this.r && 0xA9 === this.g && 0xA9 === this.b)
return "darkGray";
else if (0x00 === this.r && 0x64 === this.g && 0x00 === this.b)
return "darkGreen";
else if (0x80 === this.r && 0x00 === this.g && 0x80 === this.b)
return "darkMagenta";
else if (0x8B === this.r && 0x00 === this.g && 0x00 === this.b)
return "darkRed";
else if (0x80 === this.r && 0x80 === this.g && 0x00 === this.b)
return "darkYellow";
else if (0x00 === this.r && 0xFF === this.g && 0x00 === this.b)
return "green";
else if (0xD3 === this.r && 0xD3 === this.g && 0xD3 === this.b)
return "lightGray";
else if (0xFF === this.r && 0x00 === this.g && 0xFF === this.b)
return "magenta";
else if (0xFF === this.r && 0x00 === this.g && 0x00 === this.b)
return "red";
else if (0xFF === this.r && 0xFF === this.g && 0xFF === this.b)
return "white";
else if (0xFF === this.r && 0xFF === this.g && 0x00 === this.b)
return "yellow";
let val = (((this.r & 0xFF) << 16) | ((this.b & 0xFF) << 8) | (this.r & 0xFF));

switch (val)
{
case 0x000000: return "black";
case 0x0000FF: return "blue";
case 0x00FFFF: return "cyan";
case 0x00008B: return "darkBlue";
case 0x008B8B: return "darkCyan";
case 0xA9A9A9: return "darkGray";
case 0x006400: return "darkGreen";
case 0x800080: return "darkMagenta";
case 0x8B0000: return "darkRed";
case 0x808000: return "darkYellow";
case 0x00FF00: return "green";
case 0xD3D3D3: return "lightGray";
case 0xFF00FF: return "magenta";
case 0xFF0000: return "red";
case 0xFFFFFF: return "white";
case 0xFFFF00: return "yellow";
}

return "";
};
Expand Down

0 comments on commit 4bc5c90

Please sign in to comment.