4 Commits
Author SHA1 Message Date
Ronny Dobra 917bdb9f90 update changelog 2017-06-27 23:45:05 +02:00
Ronny Dobra 8ac5abbd8c update screenshots 2017-06-27 23:43:47 +02:00
Ronny Dobra 624fd7bb67 fix issue #13 ( 2017-06-27 23:34:11 +02:00
Ronny Dobra 33765cdef1 add missing meson file (issue #16) 2017-06-26 23:07:10 +02:00
9 changed files with 197 additions and 101 deletions

No files matched your search

+119 -33
View File
@@ -1,33 +1,119 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2017 Ronny Dobra <ronnydobra at arcor dot de> -->
<component type="desktop">
<id>com.github.ronnydo.colorpicker.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0+</project_license>
<name>Color Picker</name>
<summary>The most intuitive Color Picker to speed up your workflow.</summary>
<description>
<p>One Color Picker to rule them all! No overhelming menus or settings. An easy tool with the features you need.</p>
<p>Features:</p>
<ul>
<li>Pick a color</li>
<li>Choose between multiple Color Formats</li>
<li>Let the Color History remember your last colors</li>
</ul>
</description>
<provides>
<binary>com.github.ronnydo.colorpicker</binary>
</provides>
<screenshots>
<screenshot type="default">
<image>https://raw.githubusercontent.com/ronnydo/colorpicker/master/data/screenshot.png</image>
</screenshot>
</screenshots>
<developer_name>Ronny Dobra</developer_name>
<url type="homepage">https://github.com/RonnyDo/ColorPicker</url>
<url type="bugtracker">https://github.com/RonnyDo/ColorPicker/issues</url>
<custom>
<value key="x-appcenter-color-primary">#A3FF91</value>
<value key="x-appcenter-color-primary-text">#333333</value>
</custom>
</component>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2017 Ronny Dobra <ronnydobra at arcor dot de> -->
<component type="desktop">
<id>com.github.ronnydo.colorpicker.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0+</project_license>
<name>Color Picker</name>
<summary>The most intuitive Color Picker to speed up your workflow.</summary>
<description>
<p>One Color Picker to rule them all! No overhelming menus or settings. An easy tool with the features you need.</p>
<p>Features:</p>
<ul>
<li>Pick a color</li>
<li>Choose between multiple Color Formats</li>
<li>Let the Color History remember your last colors</li>
</ul>
</description>
​<categories>
​ <category>GTK</category>
​ <category>Utility</category>
<category>Graphics</category>
<category>Development</category>
</categories>
​<launchable type="desktop-id">com.github.ronnydo.colorpicker.desktop</launchable>
<releases>
​<release version="0.9.5" date="2017-06-27" urgency="medium">
​ <description>
<ul>
<li>Fix dark color scheme bug (issue #13)</li>
<li>Enhance project description</li>
</ul>
</description>
​</release>
​<release version="0.9.4" date="2017-06-26" urgency="medium">
​ <description>
<ul>
<li>Fix build bug (issue #16)</li>
</ul>
</description>
​</release>
​<release version="0.9.3" date="2017-06-26" urgency="medium">
​ <description>
<ul>
<li>Color Picker now restores your recent window position, color format and color history! (issue #10, issue #11 and issue #15)</li>
<li>Minor icon changes</li>
</ul>
</description>
​</release>
​<release version="0.9.2" date="2017-06-23" urgency="low">
​ <description>
<ul>
<li>Fix issue #8</li>
</ul>
</description>
​</release>
​<release version="0.9.1" date="2017-06-23" urgency="low">
​ <description>
<ul>
<li>Fix issue #8</li>
</ul>
</description>
​</release>
​<release version="0.9.0" date="2017-06-22" urgency="medium">
​ <description>
<ul>
<li>Beta release</li>
<li>Fix issue #4</li>
<li>Fix issue #5</li>
<li>Fix issue #6</li>
<li>Fix issue #7</li>
<li>Update icons</li>
<li>Add German translation</li>
</ul>
</description>
​</release>
​<release version="0.1.2" date="2017-06-21" urgency="low">
​ <description>
<ul>
<li>Fix build information</li>
</ul>
</description>
​</release>
​<release version="0.1.1" date="2017-06-19" urgency="low">
​ <description>
<ul>
<li>Added debian files and logo files</li>
</ul>
</description>
​</release>
​<release version="0.1.0" date="2017-06-15" urgency="low">
​ <description>
<ul>
<li>First official release</li>
</ul>
</description>
​</release>
<release version="1.0" date="2012-08-26"/>
​ </releases>
<provides>
<binary>com.github.ronnydo.colorpicker</binary>
</provides>
<screenshots>
<screenshot type="default">
<caption>Normal variant</caption>
<image>https://raw.githubusercontent.com/ronnydo/colorpicker/master/data/screenshot.png</image>
</screenshot>
<screenshot>
<caption>Dark variant</caption>
<image>https://raw.githubusercontent.com/ronnydo/colorpicker/master/data/screenshot_dark.png</image>
</screenshot>
</screenshots>
<developer_name>Ronny Dobra</developer_name>
<url type="homepage">https://github.com/RonnyDo/ColorPicker</url>
<url type="bugtracker">https://github.com/RonnyDo/ColorPicker/issues</url>
<custom>
<value key="x-appcenter-color-primary">#A3FF91</value>
<value key="x-appcenter-color-primary-text">#333333</value>
</custom>
</component>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

+13 -1
View File
@@ -1,6 +1,18 @@
com.github.ronnydo.colorpicker (0.9.5) xenial; urgency=medium
* Fix issue #13
-- Ronny Dobra <ronnydobra at arcor dot de> Thu, 27 Jun 2017 23:20:00 +0100
com.github.ronnydo.colorpicker (0.9.4) xenial; urgency=medium
* Fix issue #16
-- Ronny Dobra <ronnydobra at arcor dot de> Thu, 26 Jun 2017 23:10:00 +0100
com.github.ronnydo.colorpicker (0.9.3) xenial; urgency=medium
* Color Picker now restores your recent window position, color format color history! (issue #10, issue #11 and issue #15)
* Color Picker now restores your recent window position, color format and color history! (issue #10, issue #11 and issue #15)
* Minor icon changes
-- Ronny Dobra <ronnydobra at arcor dot de> Thu, 26 Jun 2017 22:45:00 +0100
+1 -1
View File
@@ -23,7 +23,7 @@ executable(
'src/ExtRGBA.vala',
'src/Widgets/ColorArea.vala',
'src/Widgets/ColorHistory.vala',
'src/Widgets/MousePosition.vala',
'src/Widgets/Picker.vala',
'src/Services/Settings.vala',
c_args: c_args,
dependencies: [
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env python3
import os
import subprocess
schemadir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas')
if not os.environ.get('DESTDIR'):
print('Compiling gsettings schemas...')
subprocess.call(['glib-compile-schemas', schemadir])
+2 -2
View File
@@ -38,7 +38,7 @@ namespace ColorPicker {
construct {
// main box
ext_active_color.parse ("#FFFFFF");
var color_area = new ColorPicker.Widgets.ColorArea ();
color_area.set_color (ext_active_color);
@@ -153,7 +153,7 @@ namespace ColorPicker {
// activate color picker
pick_color_button.clicked.connect (() => {
var mouse_position = new ColorPicker.Widgets.MousePosition ();
var mouse_position = new ColorPicker.Widgets.Picker ();
mouse_position.show_all ();
mouse_position.moved.connect ((t, color) => {
+48 -61
View File
@@ -29,12 +29,11 @@ namespace ColorPicker.Widgets {
Gee.ArrayList<Gdk.RGBA?> color_list;
const int border_width = 1;
const string border_color_string = "rgba(50, 50, 50, 0.4)";
// hardcoded from /usr/share/themes/elementary/gtk-3.0/[gtk.css|gtk-dark.css]
const string border_color_string = "rgba(0, 0, 0, 0.25)";
private Gdk.RGBA border_color = Gdk.RGBA();
const string triangle_color_string = "#F5F5F5";
private Gdk.RGBA triangle_color = Gdk.RGBA();
const int shadow_width = 16;
const string shadow_color_string = "#000000";
//const string shadow_color_string = "#A9A9A9";
@@ -43,13 +42,12 @@ namespace ColorPicker.Widgets {
int selected_color = 0;
public ColorHistory () {
public ColorHistory () {
set_size_request (100, 28);
add_events(Gdk.EventMask.BUTTON_PRESS_MASK | Gdk.EventMask.BUTTON_RELEASE_MASK | Gdk.EventMask.ENTER_NOTIFY_MASK);
color_list = new Gee.ArrayList<Gdk.RGBA?> ();
restore_colors ();
restore_colors ();
border_color.parse (border_color_string);
triangle_color.parse (triangle_color_string);
}
construct {
@@ -60,7 +58,7 @@ namespace ColorPicker.Widgets {
var color_array = settings.color_history;
if (color_array != null) {
// if more colors should be saved as allowed, drop the oldest ones.
// drop oldest colors, if more colors are stored as allowed
if (max_colors < color_array.length) {
int offset = color_array.length - max_colors;
var sliced_array = color_array [offset:color_array.length];
@@ -105,14 +103,18 @@ namespace ColorPicker.Widgets {
public Gee.ArrayList<Gdk.RGBA?> get_color_list () {
return color_list;
}
}
/* Widget is asked to draw itself */
public override bool draw (Cairo.Context ctx) {
int width = get_allocated_width (); // better element_width / amount
if (color_list == null && color_list.size <= 0) {
return true;
}
int width = get_allocated_width ();
int height = get_allocated_height ();
var style_context = get_toplevel ().get_style_context ();
// colorboxes
for (int i = 0; i < color_list.size; i++) {
@@ -127,8 +129,7 @@ namespace ColorPicker.Widgets {
Gdk.cairo_set_source_rgba (ctx, color_list.get (i));
ctx.fill ();
}
}
// simple shade
ctx.new_path ();
@@ -140,8 +141,7 @@ namespace ColorPicker.Widgets {
Gdk.cairo_set_source_rgba (ctx, s);
ctx.set_line_width (border_width);
ctx.stroke ();
ctx.stroke ();
/*
// real faded shade
@@ -159,53 +159,40 @@ namespace ColorPicker.Widgets {
Gdk.cairo_set_source_rgba (ctx, shadow_color);
ctx.stroke ();
}
*/
// colorboxes border
*/
// triangle fill
ctx.new_path ();
ctx.move_to (0, 0);
ctx.rel_line_to (width, 0);
ctx.rel_line_to (0, height);
ctx.rel_line_to (-1 * width, 0);
ctx.close_path ();
Gdk.cairo_set_source_rgba (ctx, border_color);
// fix: stright lines must be + 1 to appear same as diagonales
ctx.set_line_width (border_width + 1);
int triangle_height = 10;
int triangle_width = 20;
// fix: "+1" against rounding error
ctx.move_to ((width / color_list.size * selected_color + 1) + (width / color_list.size / 2 + 1) - triangle_width / 2, height);
ctx.rel_line_to (triangle_width / 2, -1 * triangle_height);
ctx.rel_line_to (triangle_width / 2, triangle_height);
ctx.close_path ();
Gdk.cairo_set_source_rgba (ctx, style_context.get_background_color(Gtk.StateFlags.NORMAL));
ctx.fill ();
// triangle border (left tip -> tip -> right tip)
ctx.new_path ();
Gdk.cairo_set_source_rgba (ctx, border_color);
ctx.set_line_width (border_width);
ctx.move_to ((width / color_list.size * selected_color + 1) + (width / color_list.size / 2 + 1) - triangle_width / 2, height);
ctx.rel_line_to (triangle_width / 2, -1 * triangle_height);
ctx.rel_line_to (triangle_width / 2, triangle_height);
ctx.stroke ();
// triangle (Is used to indicate the selected color, which isn't implemented yet)
if (color_list.size > 0) {
ctx.new_path ();
int triangle_height = 10;
int triangle_width = 20;
// fix: "+1" against rounding error
ctx.move_to ((width / color_list.size * selected_color + 1) + (width / color_list.size / 2 + 1), height - triangle_height);
ctx.rel_line_to (triangle_width / 2, triangle_height);
ctx.rel_line_to (-1 * triangle_width, 0);
ctx.close_path ();
Gdk.cairo_set_source_rgba (ctx, triangle_color);
ctx.fill ();
// triangle border
ctx.new_path ();
// fix: "+1" against rounding error
ctx.move_to ((width / color_list.size * selected_color + 1) + (width / color_list.size / 2 + 1) - triangle_width / 2, height);
ctx.rel_line_to (triangle_width / 2, -1 * triangle_height);
ctx.rel_line_to (triangle_width / 2, triangle_height);
Gdk.cairo_set_source_rgba (ctx, border_color);
ctx.set_line_width (border_width);
ctx.stroke ();
}
// continue from right triangle tip to draw around the ColorHistory border
ctx.set_line_width (border_width +1);
ctx.move_to ((width / color_list.size * selected_color + 1) + (width / color_list.size / 2 + 1) + triangle_width / 2, height);
ctx.line_to (width, height);
ctx.line_to (width, 0);
ctx.line_to (0, 0);
ctx.line_to (0, height);
ctx.line_to ((width / color_list.size * selected_color + 1) + (width / color_list.size / 2 + 1) - triangle_width / 2, height);
ctx.stroke ();
return true;
}
@@ -21,7 +21,7 @@
namespace ColorPicker.Widgets {
public class MousePosition : Granite.Widgets.CompositedWindow {
public class Picker : Granite.Widgets.CompositedWindow {
public signal void picked (Gdk.RGBA color);
public signal void cancelled ();
@@ -31,7 +31,7 @@ namespace ColorPicker.Widgets {
type = Gtk.WindowType.POPUP;
}
public MousePosition () {
public Picker () {
stick ();
set_resizable (true);
set_deletable (false);
@@ -39,8 +39,9 @@ namespace ColorPicker.Widgets {
set_skip_pager_hint (true);
set_keep_above (true);
var screen = get_screen ();
var screen = get_screen ();
set_default_size (screen.get_width (), screen.get_height ());
}