Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation of DecorationOptions.minimap.color is misleading - requires hex color, but suggests rgba value #4178

Open
1 of 2 tasks
loggerhead opened this issue Sep 16, 2023 · 5 comments
Labels
bug Issue identified by VS Code Team member as probable bug editor-core help wanted Issues identified as good community contribution opportunities

Comments

@loggerhead
Copy link

loggerhead commented Sep 16, 2023

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

https://microsoft.github.io/monaco-editor/playground.html?source=v0.43.0#XQAAAAL7AgAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscw2TcEZXzoBtNlUc7JzE2-DhoNDFBSkDmlgvjP1KVtLQwdHRjhIeDx49tkFMDLg8b1ZhKomfU-9w2kA_D3MW4_oNk7QIk1mQL85HKSYHkRp3QU9cYcXB43cuykA7hkX15yecdhCcufisaHuhSdCgJIRFeiTdDaFqPDRZYELSIMSCyWgPB_L52XaYR6_FUmpgVVHcNpTwBFUIlRFIaUn_TEu6YEgblbTvRXcvBlrecA2jjlvJnVdG0yN562AJIHaHzf2-CzPlIxoyOubwlDlrKk_-qYc-N3JRDrwcpqJnhiQuhDqXbKNKjvixOMZJJ2mNES7tftCjj8Vz3zgAiuH90D41MoWXNZw2yBUNhyHnRJ91BetX_NCFsp1n41mbJhtHqVpzSXcnVbazCA2IC2pjG8M7DidhfhrL7TWbGwO6tpklBQeJF7RW1S3FvFiMiHYtSmJRmruTROsBtOWYIs4NKgyJ-loR7v47965aW4aws-49QqdPZ7GUihA1lQ2RqueqKnCBR9HGRuuIKHjLHllWWMwY5Pz-raUhXPc5P_Aj5UAA

Monaco Editor Playground Code

var jsCode = [
	'"use strict";',
	"function Person(age) {",
	"	if (age) {",
	"		this.age = age;",
	"	}",
	"}",
	"Person.prototype.getAge = function () {",
	"	return this.age;",
	"};",
].join("\n");

var editor = monaco.editor.create(document.getElementById("container"), {
	value: jsCode,
	language: "javascript",
	minimap: { enabled: true },
});

var decorations = editor.createDecorationsCollection([
	{
		range: new monaco.Range(3, 1, 5, 1),
		options: {
			isWholeLine: true,
			className: "myLineDecoration",
			minimap: {
				color: "rgba(67, 201, 249, 0.8)",
				position: monaco.editor.MinimapPosition.Inline,
			}
		},
	}
]);
.myLineDecoration {
	background: rgba(67, 201, 249, 0.8);
}

Reproduction Steps

No response

Actual (Problematic) Behavior

image

Expected Behavior

show blue color.

Additional Context

No response

@hediet
Copy link
Member

hediet commented Oct 5, 2023

The actual behavior seems to match the expected behavior? The color seems blue to me.

@hediet hediet closed this as not planned Won't fix, can't repro, duplicate, stale Oct 5, 2023
@loggerhead
Copy link
Author

The actual behavior seems to match the expected behavior? The color seems blue to me.

But I see it's red, and you can see it's red in the screenshot too. Do you speak about the color of minimap?

@hediet
Copy link
Member

hediet commented Oct 6, 2023

Ahh, you meant the minimap! Sorry, I'm going through so many issues and this one didn't have explicit "Actual Behavior" steps.

@hediet hediet reopened this Oct 6, 2023
@hediet
Copy link
Member

hediet commented Oct 6, 2023

This works

Only hex values are supported.

I see that the docs are misleading:

chrome_7xLblldGkb

@hediet hediet changed the title [Bug] The color setting for minimap is not taking effect. Documentation of DecorationOptions.minimap.color is misleading - requires hex color, but suggests rgba value Oct 6, 2023
@hediet hediet added bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities editor-core labels Oct 6, 2023
@loggerhead
Copy link
Author

This works

Only hex values are supported.

I see that the docs are misleading:

chrome_7xLblldGkb

Can you check this demo? I think there are two issues:

  1. Not every line of the range is highlight even when I enabled isWholeLine.
  2. The first line of the range appears lighter than other lines, seems like alpha is lost from hex.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug editor-core help wanted Issues identified as good community contribution opportunities
Projects
None yet
Development

No branches or pull requests

2 participants