Fix bright option (#7622)
Setting the option to true, then to false would not turn off bright attribute.
This commit is contained in:
parent
4a9f6f00ad
commit
e237428d42
1 changed files with 4 additions and 4 deletions
|
|
@ -557,8 +557,8 @@ proc setForegroundColor*(f: File, fg: ForegroundColor, bright=false) =
|
|||
when defined(windows):
|
||||
let h = conHandle(f)
|
||||
var old = getAttributes(h) and not FOREGROUND_RGB
|
||||
if bright:
|
||||
old = old or FOREGROUND_INTENSITY
|
||||
old = if bright: old or FOREGROUND_INTENSITY
|
||||
else: old and not(FOREGROUND_INTENSITY)
|
||||
const lookup: array[ForegroundColor, int] = [
|
||||
0,
|
||||
(FOREGROUND_RED),
|
||||
|
|
@ -579,8 +579,8 @@ proc setBackgroundColor*(f: File, bg: BackgroundColor, bright=false) =
|
|||
when defined(windows):
|
||||
let h = conHandle(f)
|
||||
var old = getAttributes(h) and not BACKGROUND_RGB
|
||||
if bright:
|
||||
old = old or BACKGROUND_INTENSITY
|
||||
old = if bright: old or BACKGROUND_INTENSITY
|
||||
else: old and not(BACKGROUND_INTENSITY)
|
||||
const lookup: array[BackgroundColor, int] = [
|
||||
0,
|
||||
(BACKGROUND_RED),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue