INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Colorfy Fonts  (Read 3960 times)

stiv32

  • World Citizen
  • ***
  • Posts: 162
Colorfy Fonts
« on: May 04, 2016, 10:43:34 am »

Is there a way to change the color of the fonts (or highlight-anotate) at certain songs in my Playing Now playlist or at any Playlist?

Can I change the color of the songs' fonts in the database (at any field)? I need for instance all songs which are tagged as "Balands" to be in blue (#0000FF) color.

Thanks in advance
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 41956
  • Shoes gone again!
Re: Colorfy Fonts
« Reply #1 on: May 05, 2016, 08:54:51 am »

I don't know how to apply it automatically, but this expression (just make an expression column) shows colored text:
<font color="0xff0000">Red!<//font>
Logged
Matt Ashland, JRiver Media Center

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8009
Re: Colorfy Fonts
« Reply #2 on: May 05, 2016, 01:17:50 pm »

You'd probably want to make a new calculated field that has an ifelse() expression triggering on the field or fields you are interested in, and then outputting the font color code that corresponds to each one.

Then use that calculated field in your Playing Now list instead of song name.

Brian.
Logged

jgreen

  • Citizen of the Universe
  • *****
  • Posts: 2419
Re: Colorfy Fonts
« Reply #3 on: May 05, 2016, 01:57:21 pm »

I've always wanted to colorfy fonts according to results shown in another field (album, sports event, whatnot).  Howabout some real-world zamples for us expression-adverse?
Logged

Llannis

  • Junior Woodchuck
  • **
  • Posts: 94
Re: Colorfy Fonts
« Reply #4 on: May 06, 2016, 12:52:53 am »

Hi everyone,

this is also close to what I need...

but, when it comes to expressions I am sorry but I don't understand where I could create them

Matt, is there a field where I could add the expression? Should I create one?
<font color="0xff0000">Red!<//font>

Blgentry, can you give me an example with the calculated data expression and a couple of other given fields, please?


can we also add a separation line like this? (it should be created when I add the tracks to the Playing Now Playlist)


___U2______________
With or without you
Every braking wave

__Cure___________
Imagine Dragons
On the top of the world


Thanks



Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8952
Re: Colorfy Fonts
« Reply #5 on: May 06, 2016, 01:30:20 am »

You can't add the separation line like you ask, certainly, not in playing now view anyway. In other views, you could potentially skin it in, by way of editing the 'Grouping' separator, and then setting the grouping how you want it, which is typically via hard coded clever defaults, or any available library field, where of course, you are free to create any field you want and so manipulate how your lists are grouped. It's very powerful, but maybe a bit overkill for what you want.

As for the colouring...

There's a lot of work if want the whole row coloured, more than is sensible to be honest, so, you're options are...
Create the expression based around a single field, and settle for that. How?
Right click a column header and choose "Add expression column". Name it in the top field. Here, I've used the [Genre] field as an example... Below name, enter your expression. "IfElse" is neat, here's why... The expression first...
Code: [Select]
ifelse(isequal([genre],Blues),<font color="0x0e02fe">[genre]<//font>,isequal([genre],Rock),<font color="0xfe02c0">[genre]<//font>,1,[genre])
This says, if genre=Blues, then use blue text, if genre=Rock, then use pink text, otherwise, just show the genre. The beauty here is that you can just keep adding these in before the "1,[genre]" at the end, and it will keep working. So, inserting "isequal([genre],Ballad),<font color="0x000000">[genre]<//font>," would turn all Ballads white, and so on... You could also create a library field using the same expression to make it easier to add to any view you liked.


If you want the whole line coloured up, you could get that by cheating. You would create either an expression based field or column that included all of the fields you wanted to see columns for, [artist] - [album] - [name] - Played [number plays] times - Last Played on [last played], for example, and then build the expression to colour keying off that new field instead of [Genre]. The two issues here you might not be able to live with are, that you would have to forego inline editing, and the pseudo columns won't line up nicely. You would be strictly reading from left to right.

The only other way is to create colouring expression columns for the whole view, so, still keying off the genre field, the two expressions below would give coloured Artist and Album fields depending on the genre.
ifelse(isequal([genre],Blues),<font color="0x0e02fe">[album]<//font>,isequal([genre],Rock),<font color="0xfe02c0">[album]<//font>,1,[album])
ifelse(isequal([genre],Blues),<font color="0x0e02fe">[artist]<//font>,isequal([genre],Rock),<font color="0xfe02c0">[artist]<//font>,1,[artist])

You would have the full line, but again, no inline editing.

-marko

jgreen

  • Citizen of the Universe
  • *****
  • Posts: 2419
Re: Colorfy Fonts
« Reply #6 on: May 06, 2016, 05:06:50 pm »

Typically excellent work, Marko!  However, my reading of the OP's request is that if any song's genre is "Ballad", for example, then the "Name" field would use a blue font.  I'm guessing this is a trivial variation of your previous example, but too much induction for my poor noggin!  Any hints?
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Colorfy Fonts
« Reply #7 on: May 06, 2016, 05:17:13 pm »

Typically excellent work, Marko!  However, my reading of the OP's request is that if any song's genre is "Ballad", for example, then the "Name" field would use a blue font.  I'm guessing this is a trivial variation of your previous example, but too much induction for my poor noggin!  Any hints?


Code: [Select]
ifelse(isequal([genre],ballad),<font color="0x0e02fe">[name]<//font>,1,[name])
this would go into a custom name field (easiest method...)
Logged

stiv32

  • World Citizen
  • ***
  • Posts: 162
Re: Colorfy Fonts
« Reply #8 on: May 11, 2016, 10:45:15 am »

Thank you all for your replies!

That right Jgreen! when the genre is i.e. "Ballad" I need the "Name" field (or the row) to be in a specific color.

Marko and Ferday I will try all the suggestions next week (I have too much work these days...) and I will get back to you!!!

Thanks again!
Logged

Llannis

  • Junior Woodchuck
  • **
  • Posts: 94
Re: Colorfy Fonts
« Reply #9 on: June 11, 2016, 05:24:46 pm »


I just had the time to try the code. It works brilliantly.

My only problem is that I use the Overview panel where the field Name is used. Can I change it (the column "Name") with my colored Expression Column?
Logged
Pages: [1]   Go Up