Documentation
¶
Overview ¶
Package percent provides options for percent field rendering in clog.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EffectiveMaximum ¶ added in v0.7.0
EffectiveMaximum returns the per-field maximum if set, otherwise def. A def of 0 (or any non-positive value) means the documented default of 1.0.
Types ¶
type Option ¶
type Option func(*Percent)
Option configures how a percent field is rendered.
func WithMaximum ¶ added in v0.7.0
WithMaximum returns an Option that overrides the logger's percent maximum for this field. For example, use WithMaximum(100) when passing values in the 0–100 range instead of the default 0–1 range.
func WithReverseGradient ¶
func WithReverseGradient() Option
WithReverseGradient returns an Option that flips the gradient direction for this field relative to the logger default. If the logger is using the normal gradient (red=0%, green=100%), the field renders inverted (green=0%, red=100%), and vice versa.