owncloud / calendar

Calendar app for ownCloud
GNU Affero General Public License v3.0
121 stars 43 forks source link

Richer Calendar colors options #135

Open elioqoshi opened 8 years ago

elioqoshi commented 8 years ago

The owncloud calendar app currently offers 33 colors to assign to calendars. I have linked Thunderbird's lightning calendar addon via CalDav with owncloud and I'm able to choose any color from the RGB spectrum for calendars in Thunderbird, while my choice is limited to 33 colors in owncloud.

This might not be something major, but sometimes it's useful to have a specific color code for a calendar (I separate my calendars by organizations for example).

Does this make sense?

georgehrke commented 8 years ago

Let's use an html5 color input. Webkit Nightly builds already supports it, so Safari will probably support it somewhat soon as well

http://caniuse.com/#feat=input-color

georgehrke commented 8 years ago

Still no support for input color in safari 9.1 :disappointed:

georgehrke commented 8 years ago

Putting on hold till Safari supports input color

georgehrke commented 8 years ago

Let's just check if input color is supported and only show the advanced input otherwise.

laspic commented 8 years ago

Hello. I'm following this issue with a lot of interest. I'm also annoyed by the lack of available colors, so I'm very impatient to be able to add one with a specific color code. Meanwhile, may I ask something ? Why here elioqoshi says that "owncloud calendar app currently offers 33 colors to assign to calendars" ? Personally, I can only choose between 9 colors. Have I misunderstood something ? (OC 9.1 ; Calendar app 1.3.3)

tcitworld commented 8 years ago

There's now a random color button. https://github.com/owncloud/calendar/pull/701

laspic commented 8 years ago

I've seen that. Nice improvement, even if it doesn't match with my needs (in particularly, I've never managed with it to get a gray and, from what i can see, the "random" always choose a new color in the same pastel palette). So, it's still easier for me to personalize color agenda via PhpMyAdmin. What about these 33 colors ?

d-tamm commented 8 years ago

For me, the random button just goes through the preselected standard colors, it does not add more colors. I think the 33 colors refer to an earlier version of owncloud. In the current version 9.0.5, I get 8 (not 9) colors in the color picker. Btw, great workaround to go in via phpMyAdmin and adjust colors there :)

protist commented 7 years ago

There used to be a workaround a few versions ago. Users could edit /var/www/owncloud/apps/calendar/lib/calendar.php manually, but this file seems to have disappeared. Does anyone know where this file is now? I still have leftover custom colours, but I can't find them anywhere.

EtlamGit commented 7 years ago

You have to put them to ./apps/calendar/js/public/app.js somewhere around line 5875. About half a year ago it was also possible to do this via a theme. But it seems to be not supported anymore.

Also here the random button just jumps randomly in these 8 colors. So quite useless in my point of view.

Defining more colors like in PullRequest #60 was not accepted, so it would be very nice to have some kind of arbitrary color picker. For me it would be sufficient, if I could define my own set of colors via a (company) theme again.

protist commented 7 years ago

Thanks @EtlamGit. I found the line, and modified it as below

--- /var/www/owncloud/apps/calendar/js/public/app.js.factory_default    2016-12-12 19:52:38.109146413 +1100
+++ /var/www/owncloud/apps/calendar/js/public/app.js    2016-12-12 20:03:00.848151134 +1100
@@ -5871,7 +5871,7 @@
            self.colors.push(self.rgbToHex(self._hslToRgb(hsl)));
        });
    } else {
-       this.colors = ['#31CC7C', '#317CCC', '#FF7A66', '#F1DB50', '#7C31CC', '#CC317C', '#3A3B3D', '#CACBCD'];
+                this.colors = ['#377EB8', '#4DAF4A', '#E41A1C', '#FF7F00', '#984EA3', '#17E3DD', '#999999', '#555555'];
    }
 });

However, after restarting apache2, and even restarting for good measure, the colour picker looked the same as before.

I also agree that a arbitrary colour picker would be very useful.

EtlamGit commented 7 years ago

I always fall into that trap also... This is caused by the fact, that scripts (.js) and style (.css) are cached in your browser, but the content (.html, .php) not. Just press CTRL-F5 to force a complete reload. Restarting apache is not necessary. You could also change this code while being logged into your cloud.

protist commented 7 years ago

In the past I've held Shift and clicked the refresh button. However, I tried both of these, and the colour picker still didn't change. Searching the web suggested that both of these should do the same thing.

EtlamGit commented 7 years ago

Yes, you are right. My solution is working only with the 9.0.x branch. The latest 9.1.x branch is using HSL defined default colors. So you have to do a two-step to get 'your' colors:

protist commented 7 years ago

@EtlamGit Apologies for the delay in replying. Hope you had a good holiday too! 😁 Thank you very much for your response; it works perfectly for me. Cheers.