Skip to content

Block transparent colors without allowTransparency#2

Merged
bgw merged 1 commit intocolor-parsingfrom
disallow-transparent-colors
Mar 30, 2018
Merged

Block transparent colors without allowTransparency#2
bgw merged 1 commit intocolor-parsingfrom
disallow-transparent-colors

Conversation

@bgw
Copy link
Owner

@bgw bgw commented Mar 29, 2018

Fixes xtermjs#1357.

cc @Tyriar

I could probably add a test with some more mocking, but I'd rather try to get the node-canvas stuff in #1 landed.

return {
css,
rgba: data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3]
rgba: (data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3]) >>> 0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coerces it to an unsigned int. There's some comments about this earlier in the file.

It's not really necessary (the bits are the same), but tends to make the resulting value more legible.

this.colors.cursor = this._parseColor(theme.cursor, DEFAULT_CURSOR);
this.colors.cursorAccent = this._parseColor(theme.cursorAccent, DEFAULT_CURSOR_ACCENT);
this.colors.selection = this._parseColor(theme.selection, DEFAULT_SELECTION);
this.colors.cursor = this._parseColor(theme.cursor, DEFAULT_CURSOR, true);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the cursor use this.allowTransparency?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cursor is drawn on a separate transparent render layer, so it should be possible to use a transparent cursor without allowTransparency, similar to how you can do a transparent selection.

@Tyriar
Copy link

Tyriar commented Mar 29, 2018

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants