colorutil

package
v0.12.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Copyright 2023 The Gitea Authors. All rights reserved. SPDX-License-Identifier: MIT

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLuminance

func GetLuminance(r, g, b float64) float64

return luminance given RGB channels Reference from: https://www.w3.org/WAI/GL/wiki/Relative_luminance

func HexToRBGColor

func HexToRBGColor(colorString string) (float64, float64, float64)

Get color as RGB values in 0..255 range from the hex color string (with or without #)

func UseLightTextOnBackground

func UseLightTextOnBackground(r, g, b float64) bool

Reference from: https://firsching.ch/github_labels.html In the future WCAG 3 APCA may be a better solution. Check if text should use light color based on RGB of background

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL