1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2026-01-01 10:13:30 +00:00

General module - Code style

This commit is contained in:
SpoinkyNL 2020-10-23 19:57:34 +02:00
parent c3b34fd397
commit 22c704e919

View File

@ -12,7 +12,7 @@ namespace Artemis.Plugins.Modules.General.DataModels.Windows
{ {
public class WindowDataModel public class WindowDataModel
{ {
public WindowDataModel(Process process, IColorQuantizerService _quantizerService) public WindowDataModel(Process process, IColorQuantizerService quantizerService)
{ {
Process = process; Process = process;
WindowTitle = process.MainWindowTitle; WindowTitle = process.MainWindowTitle;
@ -22,7 +22,7 @@ namespace Artemis.Plugins.Modules.General.DataModels.Windows
ProgramLocation = process.GetProcessFilename(); ProgramLocation = process.GetProcessFilename();
// Get Icon colors // Get Icon colors
if(File.Exists(ProgramLocation)) if (File.Exists(ProgramLocation))
{ {
using MemoryStream mem = new MemoryStream(); using MemoryStream mem = new MemoryStream();
Icon.ExtractAssociatedIcon(ProgramLocation).Save(mem); Icon.ExtractAssociatedIcon(ProgramLocation).Save(mem);
@ -30,15 +30,15 @@ namespace Artemis.Plugins.Modules.General.DataModels.Windows
using SKBitmap skbm = SKBitmap.Decode(mem); using SKBitmap skbm = SKBitmap.Decode(mem);
mem.Close(); mem.Close();
List<SKColor> skClrs = _quantizerService.Quantize(skbm.Pixels.ToList(), 256).ToList(); List<SKColor> skClrs = quantizerService.Quantize(skbm.Pixels.ToList(), 256).ToList();
Colors = new IconColorsDataModel Colors = new IconColorsDataModel
{ {
Vibrant = _quantizerService.FindColorVariation(skClrs, ColorType.Vibrant, true), Vibrant = quantizerService.FindColorVariation(skClrs, ColorType.Vibrant, true),
LightVibrant = _quantizerService.FindColorVariation(skClrs, ColorType.LightVibrant, true), LightVibrant = quantizerService.FindColorVariation(skClrs, ColorType.LightVibrant, true),
DarkVibrant = _quantizerService.FindColorVariation(skClrs, ColorType.DarkVibrant, true), DarkVibrant = quantizerService.FindColorVariation(skClrs, ColorType.DarkVibrant, true),
Muted = _quantizerService.FindColorVariation(skClrs, ColorType.Muted, true), Muted = quantizerService.FindColorVariation(skClrs, ColorType.Muted, true),
LightMuted = _quantizerService.FindColorVariation(skClrs, ColorType.LightMuted, true), LightMuted = quantizerService.FindColorVariation(skClrs, ColorType.LightMuted, true),
DarkMuted = _quantizerService.FindColorVariation(skClrs, ColorType.DarkMuted, true), DarkMuted = quantizerService.FindColorVariation(skClrs, ColorType.DarkMuted, true)
}; };
} }
} }