본문 바로가기
Programming

[programming] Color Scripter 활용

by x-coder 2023. 9. 17.

Hello. { #Somebody }

소스 코드 포스팅을 위해 Color Scripter 활용

 

티스토리에서도 소스코드 인용하기를 이용하면 충분히 소스코드를 꾸미게 될 수 있는데,

Color Scripter라는 새로운 것을 알게 되어 기록합니다.

 

Color Scripter
https://colorscripter.com/

 

예를 들어, 티스토리에서 코드블럭을 아래와 같이 삽입할 수 있습니다.

import os
from PIL import Image

def main():
    size = (512, 512)
    
    imageFile = "sample_image.jpg"
    
    filePath = ("%s_resized.%s" % (os.path.splitext(imageFile)[0], "jpg"))
    
    try:
        image = Image.open(imageFile)
        image.thumbnail(size)
        image.save(filePath, 'JPEG', quality=100)
        
    except IOError:
        print("Failed to create thumbnail of %s" % imageFile)
        
if __name__ == '__main__':
    main()
음...개인적으로 보기에 별로인 것 같습니다.

 

그런데 Color Scripter을 통해 코드를 꾸며 준 후에 HTML로 변환하면

아래와 같이 삽입할 수 있습니다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import os
from PIL import Image
 
def main():
    size = (512512)
    
    imageFile = "sample_image.jpg"
    
    filePath = ("%s_resized.%s" % (os.path.splitext(imageFile)[0], "jpg"))
    
    try:
        image = Image.open(imageFile)
        image.thumbnail(size)
        image.save(filePath, 'JPEG', quality=100)
        
    except IOError:
        print("Failed to create thumbnail of %s" % imageFile)
        
if __name__ == '__main__':
    main()
cs
오...서브라임 블랙 스타일로 소스코드를 꾸밀 수 있습니다. 좀 더 낫죠?

 

다른 사람들에게 소스 코드를 전달 시에 HTML로 변환해서 전달하면,

동일한 스타일로 보낼 수 있는 장점이 있으니 많이 활용하면 좋을 것 같습니다 :)

 

언제나 새로운 것은 반갑다.

Bye. { #Somebody }