LabelColor

com.worxbend.codeberg4s.issues.LabelColor$package.LabelColor
object LabelColor

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
LabelColor.type

Members list

Value members

Concrete methods

def from(value: String): Either[ValidationError, LabelColor]

Parses a label colour.

Parses a label colour.

Trims surrounding whitespace, drops a leading #, and lowercases the digits. Rejects anything that is not three or six hexadecimal digits.

Checked by counting the digits and then scanning them, rather than by a regular expression. Every label Forgejo returns carries a colour, so this runs once per label on every issue and label listing; a Pattern match allocates a Matcher and a match result per call, and the grammar it encodes — a length and an alphabet — is cheaper to state directly.

Attributes

Returns

the normalised colour, or a ValidationError on the "labelColor" field

Extensions

Extensions

extension (color: LabelColor)
def hashed: String

The colour with a leading #, the form Forgejo documents for CreateLabelOption.color.

The colour with a leading #, the form Forgejo documents for CreateLabelOption.color.

Attributes

def value: String

The colour as bare lowercase hexadecimal digits, without a # — the form Forgejo returns.

The colour as bare lowercase hexadecimal digits, without a # — the form Forgejo returns.

Attributes