color space 0...1

This commit is contained in:
rebornix 2017-09-20 12:59:02 -07:00
parent e129b2c7df
commit ce20acd130
4 changed files with 6 additions and 6 deletions

View file

@ -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);
});
});

View file

@ -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);
});
});

View file

@ -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);
});
});

View file

@ -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
};