Which script editor can code-color hex color values? - editor

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.

Related

is it possible to change font build by svg images color in iOS?

I have font build by group of images to save writing shape, so this font is unicode and each unicode character presents a single word, until now every thing working fine with font coloring in the application.
after we update the font to contain static colors (inside the font ttf) the issue appear that I cannot change the uncolored parts of the glyph.
please see the attached image that contain four characters the first two was colored correctly (blue) but the others were not.
is there any suggestion to replace the black color only in the character with white color to be used in the Dark mode ?

What is the color code for iOS system labels in both light and dark mode?

Human Interface Guidelines, "Color" section talks about the using system color is preferred. There are color codes for all system colors however for the foreground content text color there only APIs provided.
So what exactly is the color code for labels in both light and dark mode? Our designers need these colors for their mockup.
https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/color/
The color code fetched from the Playground does not seem right. The hex codes are all the same.
The RGB values of secondary, tertiary, and quaternary label colour are in fact the same. They only differ in the alpha value, which you might have forgotten about :)
From what I observed:
Label colour has 100% alpha
Secondary label colour has 60% alpha
Tertiary label colour has 30% alpha
Quaternary label colour has 18% alpha
Here's another way to find the hex value of a system colour. Go to the asset catalog of an Xcode project. Add a colour set:
Then, select "Any Appearance" or "Dark Appearance" depending on which one you want ("Any Apperance" means "not dark"). You can even check the "High Contrast" box to have more options for how your dynamic colour will look depending on the situation.
Then select your desired colour from the "Content" dropdown (see freehand circle).
Finally, you can click on "Show Color Panel" to see the hex:

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:

Using Color Structure Descriptor

According to Colour Structure Descriptor (CSD) definition it says, CSD can be use to express the structure of colours in an image using HMMD colour space. But how?
Since it gives number of times a colour appear, how can we derive the position from it?
If it is impossible, what could I do to extract the structure of colours in an image.
(Basically I want an output to express some thing similar. Example: Blue on top part, Green on middle part and Brown on bottom part.)

Resources