This commit is contained in:
parent
cbeceeb0f7
commit
742ba7dced
@ -1,57 +0,0 @@
|
||||
From ef3fd95a32572c20b8e8e407b45726be4a95bcfd Mon Sep 17 00:00:00 2001
|
||||
From: Kai Uwe Broulik <kde@privat.broulik.de>
|
||||
Date: Thu, 26 Jan 2017 16:21:09 +0100
|
||||
Subject: [PATCH 1/2] [Color Picker] Add border around color if contrast to
|
||||
surrounding view is too little
|
||||
|
||||
When picking a light color on a light panel, it might not be obvious that the color is shown there.
|
||||
Add a border around the picked color if contrast is too little.
|
||||
|
||||
Differential Revision: https://phabricator.kde.org/D4224
|
||||
---
|
||||
applets/colorpicker/package/contents/ui/main.qml | 29 ++++++++++++++++++++++++
|
||||
1 file changed, 29 insertions(+)
|
||||
|
||||
diff --git a/applets/colorpicker/package/contents/ui/main.qml b/applets/colorpicker/package/contents/ui/main.qml
|
||||
index b45d00486..845391cd8 100644
|
||||
--- a/applets/colorpicker/package/contents/ui/main.qml
|
||||
+++ b/applets/colorpicker/package/contents/ui/main.qml
|
||||
@@ -189,6 +189,35 @@ Item {
|
||||
height: units.roundToIconSize(pickerIcon.height) * 0.75
|
||||
radius: width / 2
|
||||
color: root.recentColor
|
||||
+
|
||||
+ function luminance(color) {
|
||||
+ if (!color) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ // formula for luminance according to https://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
|
||||
+
|
||||
+ var a = [color.r, color.g, color.b].map(function (v) {
|
||||
+ return (v <= 0.03928) ? v / 12.92 :
|
||||
+ Math.pow( ((v + 0.055) / 1.055), 2.4 );
|
||||
+ });
|
||||
+
|
||||
+ return a[0] * 0.2126 + a[1] * 0.7152 + a[2] * 0.0722;
|
||||
+ }
|
||||
+
|
||||
+ border {
|
||||
+ color: theme.textColor
|
||||
+ width: {
|
||||
+ var contrast = luminance(theme.viewBackgroundColor) / luminance(colorCircle.color) + 0.05;
|
||||
+
|
||||
+ // show border only if there's too little contrast to the surrounding view
|
||||
+ if (contrast > 3) {
|
||||
+ return 0;
|
||||
+ } else {
|
||||
+ return Math.round(Math.max(units.devicePixelRatio, width / 20));
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
--
|
||||
2.11.0
|
||||
|
@ -1,43 +0,0 @@
|
||||
From 75fd9dda750c6bc192e56ed16d34a0920bdf41df Mon Sep 17 00:00:00 2001
|
||||
From: Kai Uwe Broulik <kde@privat.broulik.de>
|
||||
Date: Thu, 26 Jan 2017 16:59:48 +0100
|
||||
Subject: [PATCH 2/2] [Color Picker] Add contrast frame around colors in popup
|
||||
|
||||
This adds a frame around the color sections, makes it look a lot nicer and improves contrast.
|
||||
|
||||
Since here the frame takes only a minor portion of surface area compared to the circle in a panel,
|
||||
I opted not to base it on luminosity, also for consistency's sake when there's 9 different colors in one view.
|
||||
|
||||
Differential Revision: https://phabricator.kde.org/D4298
|
||||
---
|
||||
applets/colorpicker/package/contents/ui/main.qml | 13 +++++++++++--
|
||||
1 file changed, 11 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/applets/colorpicker/package/contents/ui/main.qml b/applets/colorpicker/package/contents/ui/main.qml
|
||||
index 845391cd8..ba1920a0c 100644
|
||||
--- a/applets/colorpicker/package/contents/ui/main.qml
|
||||
+++ b/applets/colorpicker/package/contents/ui/main.qml
|
||||
@@ -318,9 +318,18 @@ Item {
|
||||
|
||||
color: delegateMouse.currentColor
|
||||
|
||||
+ border {
|
||||
+ color: theme.textColor
|
||||
+ width: Math.round(units.devicePixelRatio)
|
||||
+ }
|
||||
+
|
||||
Rectangle {
|
||||
- anchors.bottom: parent.bottom
|
||||
- width: parent.width
|
||||
+ anchors {
|
||||
+ bottom: parent.bottom
|
||||
+ left: parent.left
|
||||
+ right: parent.right
|
||||
+ margins: rect.border.width
|
||||
+ }
|
||||
height: colorLabel.contentHeight + 2 * units.smallSpacing
|
||||
color: theme.backgroundColor
|
||||
opacity: 0.8
|
||||
--
|
||||
2.11.0
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:94529ea504f98f10d238e96a4c8d02d1f3458bf062386123668451ddbf1ef280
|
||||
size 2041148
|
3
kdeplasma-addons-5.9.95.tar.xz
Normal file
3
kdeplasma-addons-5.9.95.tar.xz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:dbcb6fe7b6548705044858a061e88032de4d10278663aeb7c6c10ad1da4e2797
|
||||
size 1549004
|
@ -1,3 +1,15 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu May 11 20:26:27 CEST 2017 - fabian@ritter-vogt.de
|
||||
|
||||
- Update to 5.9.95
|
||||
* New feature release
|
||||
* For more details please see:
|
||||
* https://www.kde.org/announcements/plasma-5.9.95.php
|
||||
- Too many changes to list here
|
||||
- Remove patches, now upstream:
|
||||
* 0001-Color-Picker-Add-border-around-color-if-contrast-to-.patch
|
||||
* 0002-Color-Picker-Add-contrast-frame-around-colors-in-pop.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Apr 25 18:58:04 CEST 2017 - lbeltrame@kde.org
|
||||
|
||||
@ -17,6 +29,7 @@ Tue Mar 21 19:21:46 CET 2017 - fabian@ritter-vogt.de
|
||||
* https://www.kde.org/announcements/plasma-5.9.4.php
|
||||
- Changes since 5.9.3:
|
||||
* None
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Feb 28 19:55:14 CET 2017 - fabian@ritter-vogt.de
|
||||
|
||||
|
@ -18,21 +18,17 @@
|
||||
|
||||
%bcond_without lang
|
||||
Name: plasma5-addons
|
||||
Version: 5.9.5
|
||||
Version: 5.9.95
|
||||
Release: 0
|
||||
# Full Plasma 5 version (e.g. 5.9.4)
|
||||
# Full Plasma 5 version (e.g. 5.8.95)
|
||||
%{!?_plasma5_bugfix: %global _plasma5_bugfix %{version}}
|
||||
# Lasted ABI-stable Plasma (e.g. 5.8 in KF5, but 5.9.4 in KUF)
|
||||
# Lasted ABI-stable Plasma (e.g. 5.8 in KF5, but 5.8.95 in KUF)
|
||||
%{!?_plasma5_version: %global _plasma5_version %(echo %{_plasma5_bugfix} | awk -F. '{print $1"."$2}')}
|
||||
Summary: Additional Plasma5 Widgets
|
||||
License: LGPL-2.1 and GPL-2.0+ and GPL-3.0
|
||||
Group: System/GUI/KDE
|
||||
Url: http://www.kde.org/
|
||||
Source: http://download.kde.org/stable/plasma/%{version}/kdeplasma-addons-%{version}.tar.xz
|
||||
# PATCH-FIX-UPSTREAM 0001-Color-Picker-Add-border-around-color-if-contrast-to-.patch kde@privat.broulik.de -- [Color Picker] Add border around color if contrast to surrounding view is too little
|
||||
Patch200: 0001-Color-Picker-Add-border-around-color-if-contrast-to-.patch
|
||||
# PATCH-FIX-UPSTREAM 0002-Color-Picker-Add-contrast-frame-around-colors-in-pop.patch kde@privat.broulik.de -- [Color Picker] Add contrast frame around colors in popup
|
||||
Patch201: 0002-Color-Picker-Add-contrast-frame-around-colors-in-pop.patch
|
||||
Source: kdeplasma-addons-%{version}.tar.xz
|
||||
BuildRequires: kf5-filesystem
|
||||
BuildRequires: cmake(KF5Activities) >= 5.25.0
|
||||
BuildRequires: cmake(KF5Config) >= 5.25.0
|
||||
@ -82,8 +78,6 @@ Additional plasmoids from upstream for use on the Plasma workspace.
|
||||
%lang_package
|
||||
%prep
|
||||
%setup -q -n kdeplasma-addons-%{version}
|
||||
%patch200 -p1
|
||||
%patch201 -p1
|
||||
|
||||
%build
|
||||
%cmake_kf5 -d build -- -DCMAKE_INSTALL_LOCALEDIR=%{_kf5_localedir}
|
||||
|
Loading…
Reference in New Issue
Block a user