What is the default background color for selected text? - background

I want to make a some text always look like it is selected, even when it is not, but I cannot find the background color for selected text. If anyone knows, please tell me the rgba color for selected text. Thank you in advance!

The color is HEX #3390ff, RGB(51,144,255), CMYK(80,44,0,0)

Why you want to change the background color, you should change the text color by adding this class for always look like it is selected .selected{color: #609;}

Related

Change index of a word in a label to a different color

I am making a program similar to wordle. Does anybody know how to change just one letter in the label to a different color? For example, making the "f" in "fight" turns red. Thanks.

pdfbox: add background color or highlight the text added using contentStream.showText

I am modifying a pdf by adding some text data. I would like to put a yellow background or highlight to the added text. I am using contentStream.showText(). Is it possible ? I thought there is some setBackGroundColor for text. Seems like its not there. I could do it by adding rectangle. Looking for some more clean implementation
Any help is really appreciated!
Prem

XAML Theme Brushes - Switching Dynamically, cursor doesn't change

First Off, I found this extremely useful page on theme brushes:
http://metro.excastle.com/xaml-system-brushes
So Roughly, on startup for WinRT/XAML I am setting my theme brush for a textbox in a stylesheet:
Foreground = TextBoxDisabledForegroundThemeBrush
Background = TextBoxDisabledBackgroundThemeBrush
Which at run time makes the textbox appear as: white border, transparent background and grey text. Which I was hoping it would make it transparent, white border and white text.
On my Tapped event, I change the textbox to:
Foreground = TextBoxButtonPressedForegroundThemeBrush
Background = TextBoxButtonPressedForegroundThemeBrush
Which is supposed to be black background, white text and white border. Which seems right, but the cursor is back and you cannot see it.
First question is, am I doing this right to change my text color? I want to change the textbox so once it is selected it stays a changed color. I think this is correct. But I am not sure if I should be setting Foreground or maybe a Font Style instead?
Unfortunately you can't change caret color so if you want your TextBox editable - you should keep the background white or otherwise light. Otherwise, controlling the look of your control in its various states is best done using VisualStateManager and that is easiest to manipulate using Blend.

Background color of NSSearchfield not working

I have a NSSearchField and I want to change its background color but i am not able to do it i tried out few things:
1) I tried to set DrawBackground TRUE and then setBackgroundColor but the value of DrawBackGround is always False either I try to set it trough code or Nib.(i don't know why?)
2)I tried out setting NSText's BackgroundColor but it is not looking good because it is not covering whole NSSearchField the extreme corners where the small search icon and cancel icon is present are left uncolored.
3)I want the searchField to have the color of the view it is lying so i decreased the alpha value of the searchField which looks good but the alpha value of text is also decreased so is there any way to make text's alpha value to remain always 1.
Thanks :)
If you look at the documentation, Apple prevents background color rendering for rounded-rectangle fields:
"In order to prevent inconsistent rendering, background color rendering is disabled for rounded-bezel text fields."
https://developer.apple.com/library/prerelease/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSTextField_Class/#//apple_ref/occ/instm/NSTextField/setDrawsBackground:
NSSearchField is extension of NSTextField, NSTextField again extension of NSView,
Not sure, but its possible to make a custom clas and overwrite drawRect function and paint with the background color.

How to sample a color within an image

I'm trying to implement some sort of eyedropper that can sample pixel color in an image and save that as an RGB or CMYK color value. Ideally it would be draggable, and perhaps function something like the magnifying loop does. If anyone can point me in the direction of code or a component that would help allot.
Thanks
Use the function NSReadPixel which gives you the color of the passed in point
To get a pixel color you can use a category on UIView: https://github.com/ivanzoid/ikit/tree/master/UIView%2BColorOfPoint
For draggabel behaviour you should use UIPanGestureRecognizer.