/*
 * @copyright Copyright (c) 2018 Oskar Kurz <oskar.kurz@gmail.com>
 *
 * @author Oskar Kurz <oskar.kurz@gmail.com>
 *
 * @license GNU AGPL version 3 or any later version
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Affero General Public License as
 *  published by the Free Software Foundation, either version 3 of the
 *  License, or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Affero General Public License for more details.
 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

import app from '../app/App.js';

/* global oc_defaults OC */
app.controller('ColorPickerController', ['$scope', function($scope) {
    $scope.hashedColor = '';

    $scope.setColor = function(object,color) {
        object.color = color;
        object.hashedColor = '#' + color;

        return object;
    }

    $scope.setHashedColor = function(object) {
        object.color = object.hashedColor.substr(1);
        return object;
    }

    $scope.getCustomBackground = function(color) {
        return { 'background-color': color };
    };
}]);

@@ -975,16 +975,17 @@
 function
+ 
 ($scope)
@@ -987,20 +987,17 @@
 cope) %7B%0A
-    
+%09
 $scope.h
@@ -1014,20 +1014,17 @@
  = '';%0A%0A
-    
+%09
 $scope.s
@@ -1045,16 +1045,17 @@
 tion
+ 
 (object,
 colo
@@ -1050,16 +1050,17 @@
 (object,
+ 
 color) %7B
@@ -1056,32 +1056,26 @@
 t, color) %7B%0A
-        
+%09%09
 object.color
@@ -1084,24 +1084,18 @@
  color;%0A
-        
+%09%09
 object.h
@@ -1121,24 +1121,18 @@
 color;%0A%0A
-        
+%09%09
 return o
@@ -1134,35 +1134,30 @@
 urn object;%0A
-    %7D%0A%0A    
+%09%7D;%0A%0A%09
 $scope.setHa
@@ -1176,16 +1176,17 @@
 function
+ 
 (object)
@@ -1188,24 +1188,18 @@
 ject) %7B%0A
-        
+%09%09
 object.c
@@ -1235,24 +1235,18 @@
 str(1);%0A
-        
+%09%09
 return o
@@ -1256,19 +1256,14 @@
 ct;%0A
-    %7D%0A%0A    
+%09%7D;%0A%0A%09
 $sco
@@ -1295,16 +1295,17 @@
 function
+ 
 (color) 
@@ -1310,24 +1310,18 @@
 ) %7B%0A
-        
+%09%09
 return %7B
  'ba
@@ -1316,17 +1316,16 @@
 return %7B
- 
 'backgro
@@ -1345,16 +1345,12 @@
 olor
- 
 %7D;%0A
-    
+%09
 %7D;%0A%7D

Use tabs instead of spaces