Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Color format handling and translation library.

License

NotificationsYou must be signed in to change notification settings

Foxcapades/golour

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go wrappers and converters for various color formats with no standard librarydependency (outside of unit tests).

Intended for use with alternative compilers such asTinyGofor use with JS/WASM build targets.

Currently, golour supports HSV/HSB, HSL, and RGB color formats and can translatebetween these types.

Each color type can additionally render itself in one or more JS/CSS friendlyformats, such as hex strings or CSS color functions.

Examples

RGB From Hex String
package mainimport ("fmt""github.com/foxcapades/golour/v1/pkg/colors")funcmain() {rgb:=colors.NewRGBFromHex("#FFEEDD")fmt.Println(rgb)// Outputs: rgba(255, 238, 221, 255)fmt.Println(rgb.HexRGB())// Outputs: #FFEEDDfmt.Println(rgb.CSSFuncRGB())// Outputs: rgb(255, 238, 221)fmt.Println(rgb.ToHSL())// Outputs: hsla(30, 100%, 93.3%, 1)}

About

Color format handling and translation library.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp