Алгоритм окраски выбора

Метод Gdb кажется лучше, но можно сделать это с strace, также:

файл

   -e write=set
               Perform a full hexadecimal and ASCII dump of all the
               data written to file descriptors listed in the spec-
               ified  set.  For example, to see all output activity
               on file descriptors 3 and 5 use -e write=3,5.   Note
               that  this is independent from the normal tracing of
               the write(2) system call which is controlled by  the
               option -e trace=write.

strace-p-e write=1-s 1024-o Это распечатывает несколько больше потребности thanyou (шестнадцатеричная часть), но Вы можете sed это легко.

5
задан csl 7 October 2009 в 14:17
поделиться

4 ответа

Может быть, негативный эффект:

псевдо:

int red = originalColor.red
int green = originalColor.green
int blue = originalColor.blue

int newRed = 255 - red
int newGreen = 255 - green
int newBlue = 255 - blue

Color negativeColor = new Color(newRed, newGreen, newBlue)

Или добавление синего цветового эффекта:

int red = originalColor.red
int green = originalColor.green
int blue = originalColor.blue

int newRed = 255 - red
int newGreen = 255 - green
int newBlue = 255 - blue + 100
if newBlue > 255 {
   newBlue = 255
   newRed = newRed - 50
   newGreen = newGreen - 50
   if newRed < 0 {newRed = 0}
   if newGreen < 0 {newGreen = 0}
}

Color negativeColor = new Color(newRed, newGreen, newBlue)
3
ответ дан 14 December 2019 в 01:12
поделиться

If you're using HSB, try shifting the hue by half the maximum value either up or down, that should give you the "opposite" color (also called the complementary color). However, this doesn't do you any good for the grey spectrum, which has no hue and will thus look identical.

If you do this with both hue and brightness, you will get a kind of "negative", which works in all cases. A true negative would have you "flip" the brightness value around the mid-point, but that doesn't work for medium-gray, which would still be medium-gray.

It not always possible to make a color brighter (what do you do with white?), so shifting both hue and brightness by half is the most reliable if you're looking for contrast.

3
ответ дан 14 December 2019 в 01:12
поделиться

Вы можете найти инструменты на http://www.easyrgb.com/ , которые дадут вам некоторые идеи.

0
ответ дан 14 December 2019 в 01:12
поделиться

One technique you can use is to swap the item's foreground (text) color and its background color. If the text and background colors of your item already have a pleasing contrast, the selected item should continue to look good.

alt text
(source: wordpress.com)

That is the technique used on this site (Stack Overflow) when you mouse-over the tags in your post. They turn from DarkBlue-on-LightBlue to LightBlue-on-DarkBlue. Try it to see the effect.

3
ответ дан 14 December 2019 в 01:12
поделиться
Другие вопросы по тегам:

Похожие вопросы: