Prompts the user to select a text color.
187335
def pickTextColor(self):
        
        clr = QColorDialog.getColor(self.textColor(),
                                    self.window(),
                                    'Pick Text Color')
        
        if clr.isValid():
            self.setTextColor(clr)
1288685
public void onBarSelected(int y) {

        switch (m_colorMode) {
            case CmsSliderBar.HUE:
                m_hue = 360 - percentOf(y, 360);
                m_tbHue.setText(Integer.toString(m_hue));
                onChange(m_tbHue);
                break;
            case CmsSliderBar.SATURATIN:
                m_saturation = 100 - percentOf(y, 100);
                m_tbSaturation.setText(Integer.toString(m_saturation));
                onChange(m_tbSaturation);
                break;
            case CmsSliderBar.BRIGHTNESS:
                m_brightness = 100 - percentOf(y, 100);
                m_tbBrightness.setText(Integer.toString(m_brightness));
                onChange(m_tbBrightness);
                break;
            case CmsSliderBar.RED:
                m_red = 255 - y;
                m_tbRed.setText(Integer.toString(m_red));
                onChange(m_tbRed);
                break;
            case CmsSliderBar.GREEN:
                m_green = 255 - y;
                m_tbGreen.setText(Integer.toString(m_green));
                onChange(m_tbGreen);
                break;
            case CmsSliderBar.BLUE:
                m_blue = 255 - y;
                m_tbBlue.setText(Integer.toString(m_blue));
                onChange(m_tbBlue);
                break;
            default:
                break;

        }
    }
1166033
function c(color, text) {
  if(chaiParam.config.disableColors)
    return text;

  return chalk[color](text);
}
610283
def confirm(text: str, default: bool = False) -> bool:
    """"""
    choices = "Y/n" if default else "y/N"
    prompt = f"{style(text, bold=True)} [{choices}]: "
    while 1:
        try:
            print(prompt, end="")
            value = input("").lower().strip()
        except (KeyboardInterrupt, EOFError):
            sys.exit(1)
        if value in ("y", "yes"):
            rv = True
        elif value in ("n", "no"):
            rv = False
        elif value == "":
            rv = default
        else:
            print_error("Error: invalid input")
            continue
        break
    return rv
626414
def selected(self):
        """"""
        self.selected_text = self.currentText()
        self.valid.emit(True, True)
        self.open_dir.emit(self.selected_text)
919488
public void setTextColor(@ColorInt int color) {
    jsonObject.addProperty(SymbolOptions.PROPERTY_TEXT_COLOR, ColorUtils.colorToRgbaString(color));
  }
675607
def toggle_highlighting(self, state):
        """"""
        if self.editor is not None:
            if state:
                self.highlight_matches()
            else:
                self.clear_matches()
1046897
private void obtainTextColor(@NonNull final TypedArray typedArray) {
        ColorStateList colorStateList =
                typedArray.getColorStateList(R.styleable.ActionPreference_android_textColor);

        if (colorStateList == null) {
            colorStateList = ContextCompat
                    .getColorStateList(getContext(), R.color.action_preference_text_color);
        }

        setTextColor(colorStateList);
    }
368734
def write_color(string, name, style='normal', when='auto'):
    
    write(color(string, name, style, when))
933308
def color_text(text, color):
    
    """
    import utool as ut
    if color is None or not ENABLE_COLORS:
        return text
    elif color == 'python':
        return highlight_text(text, color)
    elif color == 'sql':
        return highlight_text(text, 'sql')
    try:
        import pygments
        import pygments.console
        # if color == 'guess':
        #     import linguist  # NOQA
        #     pygments.lexers.guess_lexer(text)
        #     return highlight_text(text, color)
        ansi_text = pygments.console.colorize(color, text)
        if ut.WIN32:
            import colorama
            ansi_reset = (colorama.Style.RESET_ALL)
        else:
            ansi_reset = pygments.console.colorize('reset', '')
        ansi_text = ansi_text + ansi_reset
        return ansi_text
    except ImportError:
        return text
1026361
def highlight_current_line(self):
        """"""
        selection = TextDecoration(self.textCursor())
        selection.format.setProperty(QTextFormat.FullWidthSelection,
                                     to_qvariant(True))
        selection.format.setBackground(self.currentline_color)
        selection.cursor.clearSelection()
        self.set_extra_selections('current_line', [selection])
        self.update_extra_selections()
119075
def _colourise(text: str, colour: str) -> str:
    
    if COLOUR:
        text = style(text, fg=colour, bold=True)
    return text
480384
def prompt(self):
        """"""
        if self.prompt_string is not None:
            return self.prompt_string

        if not self.color_enabled:
            return (' '.join(self.command) + '>> ').encode('utf8')

        color = '34'
        sub_color = '37'

        prompt_cmd = [
            self.colorize('1;' + color, part) if part != self.cmd_sub_str else
            self.colorize('0;' + sub_color, u'\u2026') for part in self.command
        ]

        return ' '.join(prompt_cmd) + self.colorize('0;' + color, '>> ')
994253
public void fontSelection() {
        
        FontChooserPanel panel = new FontChooserPanel(textFont);
        int result
                = JOptionPane.showConfirmDialog(
                        this, panel, "Font Selection",
                        JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE
                );
        
        if (result == JOptionPane.OK_OPTION) {
            textFont = panel.getSelectedFont();
            
        }
    }
815720
public void setColoringEnable(boolean coloring)
  {
    m_enableColoring = coloring;
    if (m_enableColoring)
      m_refresher.redrawTune();
    else
    {
        ((DefaultStyledDocument)getDocument()).setCharacterAttributes(
    0,getDocument().getEndPosition().getOffset(),m_defaultStyle, true);
      //setSelectedTextColor(SELECTION_FOREGROUND_COLOR);
      //setSelectionColor(SELECTION_BACKGROUND_COLOR);
    }
  }
3609
def draw_text(self, text:str, x:float, y:float, *,
                  font_name:str, font_size:float, fill:Color) -> None:
        """"""
        pass
1359843
def color(self, value):
        """"""

        if value != self.color:
            self._color = value
            self._render()