mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
color space 0...1
This commit is contained in:
parent
e129b2c7df
commit
ce20acd130
|
@ -65,7 +65,7 @@ export function activate(context: ExtensionContext) {
|
|||
return client.sendRequest(DocumentColorRequest.type, params).then(symbols => {
|
||||
return symbols.map(symbol => {
|
||||
let range = client.protocol2CodeConverter.asRange(symbol.range);
|
||||
let color = new Color(symbol.color.red * 255, symbol.color.green * 255, symbol.color.blue * 255, symbol.color.alpha);
|
||||
let color = new Color(symbol.color.red, symbol.color.green, symbol.color.blue, symbol.color.alpha);
|
||||
return new ColorInformation(range, color);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -82,7 +82,7 @@ export function activate(context: ExtensionContext) {
|
|||
return client.sendRequest(DocumentColorRequest.type, params).then(symbols => {
|
||||
return symbols.map(symbol => {
|
||||
let range = client.protocol2CodeConverter.asRange(symbol.range);
|
||||
let color = new Color(symbol.color.red * 255, symbol.color.green * 255, symbol.color.blue * 255, symbol.color.alpha);
|
||||
let color = new Color(symbol.color.red, symbol.color.green, symbol.color.blue, symbol.color.alpha);
|
||||
return new ColorInformation(range, color);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -127,7 +127,7 @@ export function activate(context: ExtensionContext) {
|
|||
return client.sendRequest(DocumentColorRequest.type, params).then(symbols => {
|
||||
return symbols.map(symbol => {
|
||||
let range = client.protocol2CodeConverter.asRange(symbol.range);
|
||||
let color = new Color(symbol.color.red * 255, symbol.color.green * 255, symbol.color.blue * 255, symbol.color.alpha);
|
||||
let color = new Color(symbol.color.red, symbol.color.green, symbol.color.blue, symbol.color.alpha);
|
||||
return new ColorInformation(range, color);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -292,9 +292,9 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
|
|||
return documentColors.map(documentColor => {
|
||||
const [red, green, blue, alpha] = documentColor.color;
|
||||
const color = {
|
||||
red: red / 255.0,
|
||||
green: green / 255.0,
|
||||
blue: blue / 255.0,
|
||||
red: red,
|
||||
green: green,
|
||||
blue: blue,
|
||||
alpha
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue