2
$\begingroup$

edit I don't want highlighting, only font color. Sorry. I want the Highlighted elements to be Blue Font. I can't understand this suggested previous post.

When I try to replace Highlighted with a Style, it doesn't change the list $r.$ Can you help?

Clear[m, n, s];
odd[n_] := 2 n - 1
SoEScratchPad[n_] := Boole[PrimeQ[odd[n]]]*odd[n]
s = Array[SoEScratchPad, 200];
rowSums[n_] := Module[{r = s[[1 ;; n]] + Reverse[s[[1 ;; n]]]},
Do[If[r[[m]] == 0 || OddQ[r[[m]]], 
  r[[m]] = Highlighted[r[[m]]]], {m, 1, Length[r]}]; r]
Array[rowSums, 20] // MatrixForm
$\endgroup$
2
  • $\begingroup$ Try Highlighted[Style[r[[m]], Blue]]. $\endgroup$ – Rohit Namjoshi Sep 27 '19 at 21:01
  • $\begingroup$ change Highlighted[r[[m]]] to Highlighted[r[[m]], BaseStyle -> Blue]? $\endgroup$ – kglr Sep 27 '19 at 21:08
3
$\begingroup$

Change Highlighted[r[[m]]] to

Style[r[[m]], 16, Blue, Bold]]

enter image description here

If you need the yellowish background, you can change Highlighted[r[[m]]] in your code to

 Highlighted[r[[m]], BaseStyle -> Directive[16, Blue, Bold]]

to get

enter image description here

$\endgroup$
3
  • 1
    $\begingroup$ Or Highlighted[Style[r[[m]], Blue, Bold]]]. $\endgroup$ – Rohit Namjoshi Sep 27 '19 at 21:19
  • $\begingroup$ The is good if we can get rid of the yellow. $\endgroup$ – Fred Kline Sep 27 '19 at 21:20
  • 2
    $\begingroup$ Remove the Highlighted, just use Style[r[[m]], Blue, Bold]. Or Highlighted[Style[r[[m]], Blue, Bold], Background -> White]. $\endgroup$ – Rohit Namjoshi Sep 27 '19 at 21:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.