How to get a heart filled of black color in katex? - katex

What I know/I tried so far:
\spadesuit or \spades renders spade with filled black color.
Similarly, \clubs or \clubsuit renders club with filled black color.
Now \hearts or \heartsuit just renders heart with white filled bg.
\colorbox treats this as a box/rectangle, thus hiding the shape obviously.
I can get black diamond as \blacklozenge
Please see this in new tab
Also, I get it that club and spade are black and the diamonds and heart are red in a deck, but I want heart symbol in black as well.
How can I get that? Thanks.
Asked on github too : https://github.com/KaTeX/KaTeX/discussions/2546

Credits and thanks to : Ronkok
KaTeX \hearts and \heartsuit render a heart outline, ♡, U+2661, , so they do not help you. The Unicode character for a filled heart is ♥, U+2665. That glyph is not in the KaTeX fonts, but you can still use it and KaTeX will substitute the glyph from the Times New Roman system font.
KaTeX emulates LaTeX, and this is not a LaTeX function, so KaTeX will write at least one error to the console (two if in strict mode). If you don't mind a console error, then no worries. KaTeX does render the heart. Just copy ♥ and paste it into your work.
Until there is any further update, this is what'll we have to work with guys.

Related

How to configure tcolorbox in lyx?

I’ve been trying for the days now to format attractive code listings in lyx for an Erlang programming book that I’m working on.
The tcolorbox package looks like it should do the trick, but frustrates me at every turn,
Requirements:
Shaded Box with rounded corners, white header text on black, black outline, black on white body text
Head centered and of the form “Listing CN.LN comment” where CN is chapter number and LN is listing number and comment is in italics.
I can do this with a LaTeX macro, but can’t make it work in the head of a shaded box.
Code listing in the body must be mono space font with bold face highlighting.
I’ve read the tcolorbox manual, but still don’t understand how it works in lyx.
Can some kind souls please help dispel my ignorance?
LRP
I'm not sure about all the details of your requirements (could you post the LaTeX that works?) Try the following to get you started (I'm using LyX 2.2.x):
Document > Settings > Modules > Fancy Colored Boxes > Add > Apply
Insert > Custom Insets > Color Box
Inside the Color Box inset, you can find Color Box Options (right-click, or ALT-A 1 in Windows). Those options look similar to the syntax of tcolorbox, e.g.:
title=An enhanced box with a color gradient, enhanced, frame style={left color=red!75!black, right color=blue!75!black}, interior style={left color=red!20!white, right color=yellow!50!white}
Finally, there's an Example (in the LyX Resources/Examples folder) called colored-boxes.lyx that has a lot of info.

How would I change the color of an emoji?

I have an emoji, and I want it to be white, but when I run the program it appears red. How do I change it to white?
rating.text = "\(♥♥♥♥♥)"
rating.textColor = UIColorRGB("ffffff")
The following answer explains why you can't change the color of Emoji characters. The glyphs are essentially images.
If you want to be able to use a heart symbol that you can color, try using one of the non-Emoji heart characters like ♥︎.
Or ensure the label's font isn't using the Apple Color Emoji font.
I needed to do this for a project and found a couple of ways to go about it. Each has its limitations, but still, usefull tricks to know.
First, you could append the unicode text presentation selector after the emoji to get it to render as text, then use your font color.
Limitations:
Text representation of that emoji might not be available and you get unknown character representation instead.
The detail of the text representation is often less
Alternatively, you can use CSS filters on the emoji itself to change its hue (plus saturation, contrast, grayscale, etc)
Limitations:
Requires access to the page's css (Works fine for your own webpage, but you couldn't, for instance, use this within an instagram post)
The emoji graphic is application-dependent, so the outcome
could be unpredictable. For instance, the folder icon on firefox is
(presently) an ugly blue color. I filter it to a yellow tint, but on
other browsers (which render it yellow to start with) the code below will cause the very problem I was trying to fix!
Anyway, here are some examples with both css and html variations of the approaches:
.folderitem_normal:before {
content:'\1f4c2';
margin-right:4px;
}
.folderitem_presentation_selector:before {
color: magenta;
content:'\1f4c2\FE0E';
margin-right:4px;
}
.folderitem_css_filter:before {
content:'\1f4c2';
filter: hue-rotate(180deg) brightness(1.5);
margin-right:4px;
}
<div class="folderitem_normal">Normal appearance of emoji for comparison (HTML 📂)</div>
<div class="folderitem_presentation_selector">Presentation selector. Notice how it has been colored like normal text. (HTML 📂︎)</div>
<div class="folderitem_css_filter">Css filter looks nice, but results are application-dependent. (HTML = N/A)</div>

How to obtain plain 'globe' Unicode character

If you include Unicode characters in an NSString, a lot of them will take on the color set for that text - they're just regular glyphs for that font so they're displayed like any other character. But there are some Unicode characters that are colored, for example GLOBE WITH MERIDIANS which is a blue gradient with shadows. But I have seen this same glyph elsewhere that's a simple black outline without a shadow, for example in the iOS keyboard. I would like to use that glyph, but without the adornments, and without having to create and use an image. I wondered if a different font would render it in a different format, and while iOSFonts.com does show different styles (bolder, italics), they're all blue. Is it possible to get the simple plain version?
Surely it is possible, because that appears to be exactly what Apple has implemented with a Tip. Notice the globe is the exact same color as the text and it's included in the string along with all the other characters. Surely that's not a UIImage?
Character in different fonts:
EDIT: The solution provided in the linked question doesn't work for this character, as the variant character appears to be the exact same as the original - blue with shadows.
Unfortunately, iOS doesn't have a monochrome globe symbol you can use; the only built-in font that includes U+1F310 GLOBE WITH MERIDIANS is Apple Color Emoji.
If you really want a font that renders this character as a simple black outline, you could package a copy of Symbola (downloadable here) into your app.
Alternatively, you could make a bitmap image with the icon you want and use NSTextAttachment to put it into an attributed string. Apple is likely doing something along these lines, as many of their Tips include symbols that are definitely not Unicode characters:

how to highlight text as it is narrated in iphone

I'm new to Objective C and developing an app which requires I need to highlight the text when it is narrated i.e.
for example consider the below sentence
"A Blue Jackal is dancing in the forest".
when A is narrated it should turn to red and all other words should be black and when Blue is narrated it should be turned to red and all other words will be shown in black.
I have used UILabel for the sentence and my problem is how to find the values of sound position and highlight it accordingly.
Could any one please share code snippet or help me regarding this.
Thanks in advance.

Which script editor can code-color hex color values?

I frequently work with lots of hexadecimal color values in my programs. Is there a script editor that can code-color the color values, based upon the colors they describe? .. (eg #FF0000 should be colored RED and 0x00FF00 should be colored GREEN)
The text editor UltraEdit has since version 20.00 the CSS color tooltip feature which is described as follows by IDM Computer Solutions, Inc.
Hovering cursor over a supported color definition causes a color "swatch" to be displayed. Users can CTRL+CLICK on "swatch" to invoke OS color picker to select a new color.
"Display CSS color tooltips" Configuration option added under Advanced -> Configuration -> Editor Display -> Miscellaneous
Detects and supports colors defined in the following formats:
Hex RGB
Functional notation RGB
RGBA
HSL
HSLA
Tooltips supported in the following file types:
HTML
CSS
Javascript
PHP
Perl
Python
Ruby
This feature does not syntax highlight the color value itself in the text file with the color according to the value. But it displays the color in a rectangle below the mouse pointer when mouse pointer is positioned over a color value in one of the supported formats.
So this feature of UltraEdit is not exactly what have been asked for, but is perhaps nevertheless very helpful for you.
In my point of view it does not really make sense to syntax highlight the color value itself in the color according to the value as this results most likely quite often in not visible or hard to see values. For example think about color value white with using white as text background color. Lots of combinations of text and background colors make the text very hard to read.
SynWrite editor can do it. #RRGGBB or rgb(rr, gg, bb) fragments are hilited.

Resources