// TODO(bep) highlight
777565
func createGenChromaStyles() *genChromaStyles {
	g := &genChromaStyles{
		baseCmd: newBaseCmd(&cobra.Command{
			Use:   "chromastyles",
			Short: "Generate CSS stylesheet for the Chroma code highlighter",
			Long: `Generate CSS stylesheet for the Chroma code highlighter for a given style. This stylesheet is needed if pygmentsUseClasses is enabled in config.

See https://help.farbox.com/pygments.html for preview of available styles`,
		}),
	}

	g.cmd.RunE = func(cmd *cobra.Command, args []string) error {
		return g.generate()
	}

	g.cmd.PersistentFlags().StringVar(&g.style, "style", "friendly", "highlighter style (see https://help.farbox.com/pygments.html)")
	g.cmd.PersistentFlags().StringVar(&g.highlightStyle, "highlightStyle", "bg:#ffffcc", "style used for highlighting lines (see https://github.com/alecthomas/chroma)")
	g.cmd.PersistentFlags().StringVar(&g.linesStyle, "linesStyle", "", "style used for line numbers (see https://github.com/alecthomas/chroma)")

	return g
}
854334
func (c Colour) Brighten(factor float64) Colour {
	r := float64(c.Red())
	g := float64(c.Green())
	b := float64(c.Blue())

	if factor < 0 {
		factor++
		r *= factor
		g *= factor
		b *= factor
	} else {
		r = (255-r)*factor + r
		g = (255-g)*factor + g
		b = (255-b)*factor + b
	}
	return NewColour(uint8(r), uint8(g), uint8(b))
}
1117201
func (s *SearchSource) Highlighter() *Highlight {
	if s.highlight == nil {
		s.highlight = NewHighlight()
	}
	return s.highlight
}
1226413
func (element *Element) addStyleRule(styleRule *StyleRule) {
	element.styleRules = append(element.styleRules, styleRule)
}
833423
func (ctx *Context) OkHTML(str string) error {
	return ctx.HTML(http.StatusOK, str)
}
1103409
func renderMarkdown(t string) (results template.HTML) {
	// We don't want auto punctuation, which changes "foo" into “foo”
	r := blackfriday.NewHTMLRenderer(blackfriday.HTMLRendererParameters{
		Flags: blackfriday.CommonHTMLFlags &^ blackfriday.Smartypants,
	})
	buf := bytes.NewBuffer(blackfriday.Run(
		[]byte(t),
		blackfriday.WithRenderer(r),
		blackfriday.WithExtensions(blackfriday.CommonExtensions)))
	out := bytes.NewBuffer(nil)
	if err := sanitizehtml.Sanitize(out, buf); err != nil {
		return template.HTML(fmt.Sprintf("Failed to render markdown: %s", template.HTMLEscapeString(err.Error())))
	}
	return template.HTML(out.String())
}
220683
func (c *Overlay) HighlightRectWithParams(v *OverlayHighlightRectParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Overlay.highlightRect", Params: v})
}
554720
func ExtractHighlightPreTag(opts ...interface{}) *opt.HighlightPreTagOption {
	for _, o := range opts {
		if v, ok := o.(*opt.HighlightPreTagOption); ok {
			return v
		}
	}
	return nil
}
670896
func (c *contractMaturityReport) AddLimboDirectHtlc(kid *kidOutput) {
	c.limboBalance += kid.Amount()

	htlcReport := htlcMaturityReport{
		outpoint:       *kid.OutPoint(),
		amount:         kid.Amount(),
		maturityHeight: kid.absoluteMaturity,
		stage:          2,
	}

	c.htlcs = append(c.htlcs, htlcReport)
}
703901
func Brightness(src image.Image, change float64) *image.RGBA {
	lookup := make([]uint8, 256)

	for i := 0; i < 256; i++ {
		lookup[i] = uint8(f64.Clamp(float64(i)*(1+change), 0, 255))
	}

	fn := func(c color.RGBA) color.RGBA {
		return color.RGBA{lookup[c.R], lookup[c.G], lookup[c.B], c.A}
	}

	img := Apply(src, fn)

	return img
}
589298
func (t *tTODO) Render(r *jet.Runtime) {
	done := "yes"
	if !t.Done {
		done = "no"
	}
	r.Write([]byte(fmt.Sprintf("TODO: %s (done: %s)", t.Text, done)))
}
354927
func (s *TextArrayOptions) SetHighlightEnabled(v bool) *TextArrayOptions {
	s.HighlightEnabled = &v
	return s
}
65743
func BrightMagenta(arg interface{}) Value {
	if val, ok := arg.(Value); ok {
		return val.BrightMagenta()
	}
	return value{value: arg, color: BrightFg | MagentaFg}
}
318542
func (list *List) PrintHighlight(element string) int {
	newIndent := len(list.indent) - 3
	indent := ""

	if newIndent > 1 {
		indent = strings.Repeat(" ", newIndent)
	}

	list.colors.Highlight.Set()
	bytes, _ := list.Print(indent + list.chooser + element)
	color.Unset()

	return bytes
}
23128
func (c *Overlay) HighlightFrameWithParams(v *OverlayHighlightFrameParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Overlay.highlightFrame", Params: v})
}
850325
func (c *Overlay) HighlightQuadWithParams(v *OverlayHighlightQuadParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Overlay.highlightQuad", Params: v})
}
1232579
func (user *User) Highlights() ([]StoryMedia, error) {
	query := []trayRequest{
		{"SUPPORTED_SDK_VERSIONS", "9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0"},
		{"FACE_TRACKER_VERSION", "10"},
		{"segmentation", "segmentation_enabled"},
		{"COMPRESSION", "ETC2_COMPRESSION"},
	}
	data, err := json.Marshal(query)
	if err != nil {
		return nil, err
	}
	body, err := user.inst.sendRequest(
		&reqOptions{
			Endpoint: fmt.Sprintf(urlUserHighlights, user.ID),
			Query:    generateSignature(b2s(data)),
		},
	)
	if err == nil {
		tray := &Tray{}
		err = json.Unmarshal(body, &tray)
		if err == nil {
			tray.set(user.inst, "")
			for i := range tray.Stories {
				if len(tray.Stories[i].Items) == 0 {
					err = tray.Stories[i].Sync()
					if err != nil {
						return nil, err
					}
				}
			}
			return tray.Stories, nil
		}
	}
	return nil, err
}