File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
templates/components/public Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change
1
+ import { isLight } from 'open-event-frontend/utils/color' ;
2
+ import Helper from '@ember/component/helper' ;
3
+
4
+ export function textColor ( color ) {
5
+ return isLight ( color ) ? '#000' : '#fff' ;
6
+ }
7
+ export default Helper . helper ( textColor ) ;
Original file line number Diff line number Diff line change 48
48
<p >
49
49
{{ #if session.startsAt }}
50
50
<strong >
51
- {{ moment-format session.startsAt ' DD MMM YY ' }}
51
+ {{ general-date session.startsAt session.event.timezone }}
52
52
</strong >
53
53
{{ /if }}
54
54
</p >
55
55
<a href =" {{ href-to ' public.sessions.list' ' all' }} #session-id-{{ session.id }} " >
56
56
<div class =" ui fluid padded" style ={{ css color =session.track.fontColor background-color =session.track.color }} >
57
- <h3 class =" item" style ={{ css user-select =' text' }} >
57
+ <h3 class =" item" style ={{ css user-select =' text' color = ( is-light session.track.color ) }} >
58
58
{{ #if (and session.startsAt session.endsAt )}}
59
59
{{ moment-format session.startsAt ' HH:mm' }} - {{ moment-format session.endsAt ' hh:mm' }}
60
60
<br >
Original file line number Diff line number Diff line change 1
1
export function getLuma ( hex : string ) : number {
2
2
// https://stackoverflow.com/a/12043228/3309666
3
- const c = hex . substring ( 1 ) ; // strip #
3
+ const c = hex . toString ( ) . substring ( 1 ) ; // strip #
4
4
const rgb = parseInt ( c , 16 ) ; // convert rrggbb to decimal
5
5
const r = ( rgb >> 16 ) & 0xff ; // extract red
6
6
const g = ( rgb >> 8 ) & 0xff ; // extract green
You can’t perform that action at this time.
0 commit comments