Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Filter valid hexadecimal color codes Post 303045965 by sean96 on Monday 20th of April 2020 09:31:14 AM
Old 04-20-2020
Filter valid hexadecimal color codes

So I have a text file containing valid and invalid hexadecimal color codes. Would I need to build a custom c program to filter the valid color codes or would a standard unix command achieve this?
 

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Using color escape codes in less

Hi all, Not sure how "for dummies" this question is, but I'd better use understatement... A. My Environment ============== I am using RedHat Linux, version 2.6.18-53.el5. When I type less --version I get: less 394 Copyright (C) 1984-2005 Mark Nudelman ... My terminal is configured... (1 Reply)
Discussion started by: Source2Exe
1 Replies

2. UNIX for Dummies Questions & Answers

Regular expression on hex color codes

I want to have all hex color codes in a given stylesheet in uppercase, so #fff should be converted to #FFF for instance. Here is the regular expression I use to match and convert hex color codes to uppercase: sed -e 's/^#({3}$)|({6}$)/^#({3}$)|({6}$)/' main.css However, no conversion to uppercase... (6 Replies)
Discussion started by: figaro
6 Replies

3. Programming

Using ANSI color codes in gcc compiled program

I have put some yellow color codes and works well. I call the funstion using print_usage(stderr, 0); I would like to know if there is any way, to store the ansi color codes in variables and then call them inside fprintf. Or have a format followed by the strings I want to output. ... (5 Replies)
Discussion started by: kristinu
5 Replies

4. UNIX for Dummies Questions & Answers

Display file with escaped color codes

Hi, I have a file containing color codes: Fri May 25 17:13:04 2012: Starting MTA: exim4^ Loading cpufreq kernel modules...^How can I display it colorized on a linux terminal? (4 Replies)
Discussion started by: ripat
4 Replies

5. Shell Programming and Scripting

Help with awk color codes based on condition

HI i have two files say test and test1 Test.txt Code: Lun01 2TB 1.99TB 99.6% Lun02 2TB 1.99TB 99.5% Lun03 2TB 1.99TB 99.5% Lun04 2TB 1.55TB 89.6% Code: Test1.txt Lun01 2TB 1.99TB 89.5% Lun02 2TB 1.99TB 99.5% Lun03 2TB 1.99TB 99.5% Requirement is to compare... (6 Replies)
Discussion started by: venkitesh
6 Replies

6. Shell Programming and Scripting

Filter Data based on codes

Hello, I have a question on how to filter the data on multiple columns. The problem is I have one table with 25 columns, 4500 rows. I need to filter out the data based on some codes like 'XXXX', I have 25 codes to check on that table. My requirement is that which ever row has this code I... (1 Reply)
Discussion started by: sandeep309
1 Replies
XStoreNamedColor()														XStoreNamedColor()

Name
  XStoreNamedColor - set RGB values of a read/write colorcell by color name.

Synopsis
  XStoreNamedColor(display, colormap, color, pixel, flags)
	Display *display;
	Colormap colormap;
	char *color;
	unsigned long pixel;
	int flags;

Arguments
  display  Specifies a connection to an X server; returned from XOpenDisplay().

  colormap
	   Specifies the colormap.

  color    Specifies the color name string (for example, "red").  This cannot be in hex format (as used in XParseColor()).  Uppercase or low-
	   ercase is not important.  The string should be in ISO LATIN-1 encoding, which means that the first 128 character codes are  ASCII,
	   and the second 128 character codes are for special characters needed in western languages other than English.

  pixel    Specifies the entry in the colormap to store color in.

  flags    Specifies which red, green, and blue indexes are set.

Description
  XStoreNamedColor() looks up the named color in the database, with respect to the screen associated with colormap, then stores the result in
  the read/write colorcell of colormap specified by pixel.  If the color name is not in the Host Portable Character Encoding, the  result  is
  implementation-dependent.   Uppercase  or  lowercase	in  name  does	not matter.  The flags argument, a bitwise OR of the constants DoRed,
  DoGreen, and DoBlue, determines which subfields within the pixel value in the cell are written.

  For more information, see Volume One, Chapter 7, Color.

Errors
  BadAccess pixel is unallocated or read-only.

  BadColor  Invalid colormap.

  BadName   color is not in server's color database.

  BadValue  pixel is not a valid index into colormap.

See Also
  XDefaultColormap(),  XDisplayCells(),  XCopyColormapAndFree(),  XCreateColormap(),  XFreeColormap(),	XGetStandardColormap(),  XInstallCol-
  ormap(), XListInstalledColormaps(), XSetStandardColormap(), XSetWindowColormap(), XUninstallColormap().

Xlib - Window Manager Hints													XStoreNamedColor()
All times are GMT -4. The time now is 08:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy