Skip to content

Commit c84e4bd

Browse files
committed
Add project
1 parent 76f3101 commit c84e4bd

32 files changed

+2541
-0
lines changed

README.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Color Picker for StreamDeck
2+
## Description
3+
4+
As a [color-blind](https://en.wikipedia.org/wiki/Color_blindness) person sometimes I struggle to recognize certain colors, so I thought it would be nice to have the functionality of [WhatColor](http://www.hikarun.com/e/) in StreamDeck. And while I was there, I decided to add the options to show their RGB or hexadecimal value.
5+
6+
When pressed, it will get the color information (name, RGB, or hexadecimal) of the pixel where the mouse is and show it on the StreamDeck key. Optionally, the the value can be copied to the clipboard.
7+
8+
Also check my [KeePass plugin](https://github.com/VictorGrycuk/StreamDeck-KeePass) for StreamDeck.
9+
10+
It was done using BarRaider's [Stream Deck Tools](https://github.com/BarRaider/streamdeck-tools).
11+
12+
## Features
13+
14+
#### Color Picker
15+
16+
When pressed, it will return either the color name, the RGB value, or the hexadecimal value of the color where the mouse is. It has the following configuration:
17+
18+
- **Value to show:** The value to show on the key:
19+
- Color name
20+
- RGB Value
21+
- Hex Value
22+
- **Copy value to clipboard:** If checked, it will copy the selected value to the clipboard. For the RGB it will copy the RGB value delimited by coma, for the hexadecimal value it will copy the hexadecimal without the hash character.
23+
24+
#### Custom Color Name
25+
26+
I am using the [WhatColor](http://www.hikarun.com/e/) names definition for the 16 VGA color. I might expand this, not sure.
27+
28+
However, I decided to leave the definition file open for customization. The file containing the definition is called `Colors.json` and can be found in the root folder of the plugin, and it consists of an array of color name and its RGB value.
29+
30+
However, have in mind that in its current state, the plugin has a static font size and long names might be cut off.
31+
32+
## Future Features
33+
34+
I am planning to add two different behaviour for the plugin:
35+
36+
- **Dynamic:** Follow the mouse around and update the data shown in the key every 1 second.
37+
- **Fixed Dynamic:** Same as above, except at a fixed screen location.
38+
39+
---
40+
41+
The icons are modified version of *Color* and *iOS Filled* at [Icon8](https://icons8.com).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30002.166
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StreamDeck.ColorPicker", "StreamDeck.ColorPicker\StreamDeck.ColorPicker.csproj", "{4635D874-69C0-4010-BE46-77EF92EB1553}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{4635D874-69C0-4010-BE46-77EF92EB1553}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{4635D874-69C0-4010-BE46-77EF92EB1553}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{4635D874-69C0-4010-BE46-77EF92EB1553}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{4635D874-69C0-4010-BE46-77EF92EB1553}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {DB3F7F7D-1381-46E1-B366-C7DE8A391A1C}
24+
EndGlobalSection
25+
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
5+
</startup>
6+
<runtime>
7+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
8+
<dependentAssembly>
9+
<assemblyIdentity name="CommandLine" publicKeyToken="5a870481e358d379" culture="neutral" />
10+
<bindingRedirect oldVersion="0.0.0.0-2.6.0.0" newVersion="2.6.0.0" />
11+
</dependentAssembly>
12+
</assemblyBinding>
13+
</runtime>
14+
</configuration>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System.Threading;
2+
3+
namespace StreamDeck.ColorPicker
4+
{
5+
public static class ClipboardHelper
6+
{
7+
internal static void SendToClipboard(string text)
8+
{
9+
var thread = new Thread(() => ClipboardThread(text));
10+
thread.SetApartmentState(ApartmentState.STA);
11+
thread.IsBackground = false;
12+
thread.Start();
13+
}
14+
15+
private static void ClipboardThread(string text)
16+
{
17+
System.Windows.Forms.Clipboard.SetText(text);
18+
}
19+
}
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
[
2+
{
3+
"Name": "Black",
4+
"Color": "0, 0, 0"
5+
},
6+
{
7+
"Name": "White",
8+
"Color": "255, 255, 255"
9+
},
10+
{
11+
"Name": "Green",
12+
"Color": "0, 128, 0"
13+
},
14+
{
15+
"Name": "Silver",
16+
"Color": "192, 192, 192"
17+
},
18+
{
19+
"Name": "Lime",
20+
"Color": "0, 255, 0"
21+
},
22+
{
23+
"Name": "Gray",
24+
"Color": "128, 128, 128"
25+
},
26+
{
27+
"Name": "Olive",
28+
"Color": "128, 128, 0"
29+
},
30+
{
31+
"Name": "Yellow",
32+
"Color": "255, 255, 0"
33+
},
34+
{
35+
"Name": "Maroon",
36+
"Color": "128, 0, 0"
37+
},
38+
{
39+
"Name": "Navy",
40+
"Color": "0, 0, 128"
41+
},
42+
{
43+
"Name": "Red",
44+
"Color": "255, 0, 0"
45+
},
46+
{
47+
"Name": "Blue",
48+
"Color": "0, 0, 255"
49+
},
50+
{
51+
"Name": "Purple",
52+
"Color": "128, 0, 128"
53+
},
54+
{
55+
"Name": "Teal",
56+
"Color": "0, 128, 128"
57+
},
58+
{
59+
"Name": "Fuchsia",
60+
"Color": "255, 0, 255"
61+
}
62+
]
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using BarRaider.SdTools;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
8+
namespace StreamDeck.ColorPicker
9+
{
10+
class Program
11+
{
12+
static void Main(string[] args)
13+
{
14+
// Uncomment this line of code to allow for debugging
15+
//while (!System.Diagnostics.Debugger.IsAttached) { System.Threading.Thread.Sleep(100); }
16+
17+
SDWrapper.Run(args);
18+
}
19+
}
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("StreamDeck.ColorPicker")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("StreamDeck.ColorPicker")]
13+
[assembly: AssemblyCopyright("Copyright © 2020")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("d8413481-5a2d-4c72-a010-25100d668729")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,minimal-ui,viewport-fit=cover">
6+
<meta name=apple-mobile-web-app-capable content=yes>
7+
<meta name=apple-mobile-web-app-status-bar-style content=black>
8+
<title>StreamDeck.ColorPicker Settings</title>
9+
<link rel="stylesheet" href="sdpi.css">
10+
<script src="sdtools.common.js"></script>
11+
<script src="PluginActionPI.js"></script>
12+
</head>
13+
<body>
14+
<div class="sdpi-wrapper">
15+
<div class="sdpi-item" id="dvValueToShow">
16+
<div class="sdpi-item-label">Value to show</div>
17+
<select class="sdpi-item-value select sdProperty" id="valueToShow" oninput="setSettings()">
18+
<option value="colorName">Color name</option>
19+
<option value="RGBValue">RGB Value</option>
20+
<option value="hexValue">Hex Value</option>
21+
</select>
22+
</div>
23+
<div type="checkbox" class="sdpi-item" id="configuration">
24+
<div class="sdpi-item-label">Copy value to clipboard</div>
25+
<div class="sdpi-item-value min100">
26+
<div class="sdpi-item-child">
27+
<input id="copyToClipboard" class="sdProperty sdCheckbox" type="checkbox" name="configuration" oninput="setSettings()">
28+
<label for="copyToClipboard" class="sdpi-item-label"><span></span>Copy</label>
29+
</div>
30+
</div>
31+
</div>
32+
</div>
33+
</body>
34+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,minimal-ui,viewport-fit=cover">
6+
<meta name=apple-mobile-web-app-capable content=yes>
7+
<meta name=apple-mobile-web-app-status-bar-style content=black>
8+
<title>StreamDeck.ColorPicker Settings</title>
9+
<link rel="stylesheet" href="sdpi.css">
10+
<script src="sdtools.common.js"></script>
11+
<script src="PluginActionPI.js"></script>
12+
</head>
13+
<body>
14+
<div class="sdpi-wrapper">
15+
<div class="sdpi-item" id="dvValueToShow">
16+
<div class="sdpi-item-label">Value to show</div>
17+
<select class="sdpi-item-value select sdProperty" id="valueToShow" oninput="setSettings()">
18+
<option value="colorName">Color name</option>
19+
<option value="RGBValue">RGB Value</option>
20+
<option value="hexValue">Hex Value</option>
21+
</select>
22+
</div>
23+
<div type="checkbox" class="sdpi-item" id="configuration">
24+
<div class="sdpi-item-label">Copy value to clipboard</div>
25+
<div class="sdpi-item-value min100">
26+
<div class="sdpi-item-child">
27+
<input id="copyToClipboard" class="sdProperty sdCheckbox" type="checkbox" name="configuration" oninput="setSettings()">
28+
<label for="copyToClipboard" class="sdpi-item-label"><span></span>Copy</label>
29+
</div>
30+
</div>
31+
</div>
32+
</div>
33+
</body>
34+
</html>
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)